Ki$ Дата: Четверг, 20.10.2011, 23:26:33 | Сообщение # 1
Группа: Пользователи
Сообщений: 14
у меня в моде diamond стоит текстдрав статистики, вот код: Code
new Text:lvlexp[MAX_PLAYERS]; new Text:InfoTextDraw[MAX_PLAYERS]; lvlexp[playerid] = TextDrawCreate(500.000000,3.500000,"_"); TextDrawAlignment(lvlexp[playerid],0); TextDrawBackgroundColor(lvlexp[playerid],0x000000ff); TextDrawFont(lvlexp[playerid],1); TextDrawLetterSize(lvlexp[playerid],0.38,2.000000); TextDrawColor(lvlexp[playerid],0xffffffff); TextDrawSetOutline(lvlexp[playerid],0); TextDrawSetProportional(lvlexp[playerid],2); TextDrawSetShadow(lvlexp[playerid],2); TextDrawShowForPlayer(playerid, lvlexp[playerid]); TextDrawDestroy(lvlexp[playerid]); // в OnPlayerDisconnect public OtherTimer() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new string[256];//статистика new exp = PlayerInfo[i][pExp]; new nxtlevel = PlayerInfo[i][pLevel]+1; new expamount = nxtlevel*levelexp; format(string,sizeof(string),"~y~LvL:~w~%d ~y~Exp:~w~%d~y~/~w~%d",PlayerInfo[i][pLevel],exp,expamount); TextDrawSetString(InfoTextDraw[i], string);//статистика } } }
всё работало отлично до тех пор пока не поставил скрипт radio вот код: Code
#include <a_samp> #undef MAX_PLAYERS #define MAX_PLAYERS 32 main() { print("FS Online radio in cars loaded."); print("Author: SDraw"); } forward NonChangeRadio(playerid); forward IsAVel(vehicleid); forward HideStationTitle(playerid); native PlayAudioStreamForPlayer(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0); native StopAudioStreamForPlayer(playerid); new VehRadio[MAX_VEHICLES]; new PassengerInCar[MAX_VEHICLES][8]; new bool:WaitForBuf[MAX_PLAYERS]; new PassengerSeat[MAX_PLAYERS]; new OldCar[MAX_PLAYERS]; new Float:StationTextCoords[16][2] = { {225.0,20.0},{280.0,20.0},{265.0,20.0},{265.0,20.0}, {260.0,20.0},{250.0,20.0},{235.0,20.0},{265.0,20.0}, {255.0,20.0},{270.0,20.0},{260.0,20.0},{250.0,20.0}, {255.0,20.0},{255.0,20.0},{270.0,20.0},{270.0,20.0} }; new StationTitle[16][1][64] = { {"CJRS Radio Montreal"}, {"Radio BN"}, {"ZenRadio.FM"}, {"METAL ONLY"}, {"Radio Paloma"}, {"MUSIK.Extream"}, {"Techno4ever Radio"},{"DEFJAY.COM"}, {"TechnoBase.FM"}, {"Music One"}, {"Radio Jackie"},{"Suburds of Goa"}, {"Groove Salad"}, {"AAN Country"},{"KickRadio"},{"Radio Off"} }; new StationUrl[15][1][64] = { {"http://shoutcast.byfly.by:88/101rap"},{"http://69.64.32.49:8000"},{"http://188.165.56.222:8800"}, {"http://80.237.157.91:4400"},{"http://80.237.184.27:80"},{"http://scfire-ntc-aa01.stream.aol.com:80/stream/1052"}, {"http://89.149.245.248:800"},{"http://83.169.60.56:80"},{"http://80.237.211.43:80"}, {"http://85.186.77.203:8000"},{"http://95.154.211.15:12614"},{"http://74.63.47.82:8850"}, {"http://74.63.47.82:8032"},{"http://76.10.222.237:9002"},{"http://173.193.202.87:9000"} }; new Text:StationText[16]; public OnFilterScriptInit() { print("----------------------------------"); print("FS Online Radio In Vehicles Loaded"); print("Author: SDraw"); print("----------------------------------"); for(new i = 0; i < MAX_VEHICLES; i++) { VehRadio[i] = 2; for(new s = 1; s < 8; s++) PassengerInCar[i][s] = INVALID_PLAYER_ID; } for(new t = 0; t < 16; t++) { StationText[t] = TextDrawCreate(StationTextCoords[t][0],StationTextCoords[t][1],StationTitle[t][0]); TextDrawAlignment(StationText[t],1); TextDrawBackgroundColor(StationText[t],0x000000ff); TextDrawFont(StationText[t],2); TextDrawLetterSize(StationText[t],0.4,1.6); TextDrawColor(StationText[t],0x906010ff); TextDrawSetOutline(StationText[t],1); TextDrawSetProportional(StationText[t],2); TextDrawSetShadow(StationText[t],1); } return 1; } public OnPlayerConnect(playerid) { WaitForBuf[playerid] = false; OldCar[playerid] = INVALID_VEHICLE_ID; return 0; } public OnPlayerStateChange(playerid,newstate,oldstate) { if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { new veh = GetPlayerVehicleID(playerid); if(IsAVel(veh)) return 0; new seat = GetPlayerVehicleSeat(playerid); if(seat != 0) { PassengerInCar[veh][seat] = playerid; PassengerSeat[playerid] = seat; OldCar[playerid] = veh; } PlayVehicleRadioForPlayer(playerid,VehRadio[veh]); } if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) { new veh = GetPlayerVehicleID(playerid); if(IsAVel(veh)) return 0; StopAudioStreamForPlayer(playerid); if(OldCar[playerid] != INVALID_VEHICLE_ID) { PassengerInCar[OldCar[playerid]][PassengerSeat[playerid]] = INVALID_PLAYER_ID; OldCar[playerid] = INVALID_VEHICLE_ID; } } return 0; } public PlayVehicleRadioForPlayer(playerid,online) { if(online == 0) { StopAudioStreamForPlayer(playerid); TextDrawShowForPlayer(playerid,StationText[15]); WaitForBuf[playerid] = true; SetTimerEx("NonChangeRadio",5000,false,"i",playerid); SetTimerEx("HideStationTitle",3500,false,"i",playerid); return 1; } StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid,StationUrl[online - 1][0]); TextDrawShowForPlayer(playerid,StationText[online - 1]); WaitForBuf[playerid] = true; SetTimerEx("NonChangeRadio",5000,false,"i",playerid); SetTimerEx("HideStationTitle",3500,false,"i",playerid); return 1; } public OnPlayerKeyStateChange(playerid,newkeys,oldkeys) { if(newkeys == KEY_ACTION) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new veh = GetPlayerVehicleID(playerid); if(IsAVel(veh)) return 0; if(WaitForBuf[playerid]) return SendClientMessage(playerid,0xFF0000FF,"* Радиостанцию нельзя сменить в течении 5-ти секунд."); VehRadio[veh]++; if(VehRadio[veh] == 16) VehRadio[veh] = 0; PlayVehicleRadioForPlayer(playerid,VehRadio[veh]); for(new s = 1; s < 8; s++) { if(PassengerInCar[veh][s] != INVALID_PLAYER_ID) PlayVehicleRadioForPlayer(PassengerInCar[veh][s],VehRadio[veh]); } } } } if(newkeys == 132) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new veh = GetPlayerVehicleID(playerid); if(IsAVel(veh)) return 0; if(WaitForBuf[playerid]) return SendClientMessage(playerid,0xFF0000FF,"* Радиостанцию нельзя сменить в течении 5-ти секунд."); VehRadio[veh]--; if(VehRadio[veh] == -1) VehRadio[veh] = 15; PlayVehicleRadioForPlayer(playerid,VehRadio[veh]); for(new s = 1; s < 8; s++) { if(PassengerInCar[veh][s] != INVALID_PLAYER_ID) PlayVehicleRadioForPlayer(PassengerInCar[veh][s],VehRadio[veh]); } } } } return 0; } public NonChangeRadio(playerid) { WaitForBuf[playerid] = false; return 1; } public HideStationTitle(playerid) { for(new i = 0; i < 16; i++) TextDrawHideForPlayer(playerid,StationText[i]); return 1; } public IsAVel(vehicleid) { new model = GetVehicleModel(vehicleid); if(model == 481 || model == 509 || model == 510) return 1; return 0; }
теперь статистика не показывает вобще, когда переключаю радио появляется по середине на пару сек и исчезает, незнаю как исправить, помогите плизззз
Сообщение отредактировал Ki$ - Четверг, 20.10.2011, 23:27:44
Сообщение у меня в моде diamond стоит текстдрав статистики, вот код: Code
new Text:lvlexp[MAX_PLAYERS]; new Text:InfoTextDraw[MAX_PLAYERS]; lvlexp[playerid] = TextDrawCreate(500.000000,3.500000,"_"); TextDrawAlignment(lvlexp[playerid],0); TextDrawBackgroundColor(lvlexp[playerid],0x000000ff); TextDrawFont(lvlexp[playerid],1); TextDrawLetterSize(lvlexp[playerid],0.38,2.000000); TextDrawColor(lvlexp[playerid],0xffffffff); TextDrawSetOutline(lvlexp[playerid],0); TextDrawSetProportional(lvlexp[playerid],2); TextDrawSetShadow(lvlexp[playerid],2); TextDrawShowForPlayer(playerid, lvlexp[playerid]); TextDrawDestroy(lvlexp[playerid]); // в OnPlayerDisconnect public OtherTimer() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new string[256];//статистика new exp = PlayerInfo[i][pExp]; new nxtlevel = PlayerInfo[i][pLevel]+1; new expamount = nxtlevel*levelexp; format(string,sizeof(string),"~y~LvL:~w~%d ~y~Exp:~w~%d~y~/~w~%d",PlayerInfo[i][pLevel],exp,expamount); TextDrawSetString(InfoTextDraw[i], string);//статистика } } }
всё работало отлично до тех пор пока не поставил скрипт radio вот код: Code
#include <a_samp> #undef MAX_PLAYERS #define MAX_PLAYERS 32 main() { print("FS Online radio in cars loaded."); print("Author: SDraw"); } forward NonChangeRadio(playerid); forward IsAVel(vehicleid); forward HideStationTitle(playerid); native PlayAudioStreamForPlayer(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0); native StopAudioStreamForPlayer(playerid); new VehRadio[MAX_VEHICLES]; new PassengerInCar[MAX_VEHICLES][8]; new bool:WaitForBuf[MAX_PLAYERS]; new PassengerSeat[MAX_PLAYERS]; new OldCar[MAX_PLAYERS]; new Float:StationTextCoords[16][2] = { {225.0,20.0},{280.0,20.0},{265.0,20.0},{265.0,20.0}, {260.0,20.0},{250.0,20.0},{235.0,20.0},{265.0,20.0}, {255.0,20.0},{270.0,20.0},{260.0,20.0},{250.0,20.0}, {255.0,20.0},{255.0,20.0},{270.0,20.0},{270.0,20.0} }; new StationTitle[16][1][64] = { {"CJRS Radio Montreal"}, {"Radio BN"}, {"ZenRadio.FM"}, {"METAL ONLY"}, {"Radio Paloma"}, {"MUSIK.Extream"}, {"Techno4ever Radio"},{"DEFJAY.COM"}, {"TechnoBase.FM"}, {"Music One"}, {"Radio Jackie"},{"Suburds of Goa"}, {"Groove Salad"}, {"AAN Country"},{"KickRadio"},{"Radio Off"} }; new StationUrl[15][1][64] = { {"http://shoutcast.byfly.by:88/101rap"},{"http://69.64.32.49:8000"},{"http://188.165.56.222:8800"}, {"http://80.237.157.91:4400"},{"http://80.237.184.27:80"},{"http://scfire-ntc-aa01.stream.aol.com:80/stream/1052"}, {"http://89.149.245.248:800"},{"http://83.169.60.56:80"},{"http://80.237.211.43:80"}, {"http://85.186.77.203:8000"},{"http://95.154.211.15:12614"},{"http://74.63.47.82:8850"}, {"http://74.63.47.82:8032"},{"http://76.10.222.237:9002"},{"http://173.193.202.87:9000"} }; new Text:StationText[16]; public OnFilterScriptInit() { print("----------------------------------"); print("FS Online Radio In Vehicles Loaded"); print("Author: SDraw"); print("----------------------------------"); for(new i = 0; i < MAX_VEHICLES; i++) { VehRadio[i] = 2; for(new s = 1; s < 8; s++) PassengerInCar[i][s] = INVALID_PLAYER_ID; } for(new t = 0; t < 16; t++) { StationText[t] = TextDrawCreate(StationTextCoords[t][0],StationTextCoords[t][1],StationTitle[t][0]); TextDrawAlignment(StationText[t],1); TextDrawBackgroundColor(StationText[t],0x000000ff); TextDrawFont(StationText[t],2); TextDrawLetterSize(StationText[t],0.4,1.6); TextDrawColor(StationText[t],0x906010ff); TextDrawSetOutline(StationText[t],1); TextDrawSetProportional(StationText[t],2); TextDrawSetShadow(StationText[t],1); } return 1; } public OnPlayerConnect(playerid) { WaitForBuf[playerid] = false; OldCar[playerid] = INVALID_VEHICLE_ID; return 0; } public OnPlayerStateChange(playerid,newstate,oldstate) { if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { new veh = GetPlayerVehicleID(playerid); if(IsAVel(veh)) return 0; new seat = GetPlayerVehicleSeat(playerid); if(seat != 0) { PassengerInCar[veh][seat] = playerid; PassengerSeat[playerid] = seat; OldCar[playerid] = veh; } PlayVehicleRadioForPlayer(playerid,VehRadio[veh]); } if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) { new veh = GetPlayerVehicleID(playerid); if(IsAVel(veh)) return 0; StopAudioStreamForPlayer(playerid); if(OldCar[playerid] != INVALID_VEHICLE_ID) { PassengerInCar[OldCar[playerid]][PassengerSeat[playerid]] = INVALID_PLAYER_ID; OldCar[playerid] = INVALID_VEHICLE_ID; } } return 0; } public PlayVehicleRadioForPlayer(playerid,online) { if(online == 0) { StopAudioStreamForPlayer(playerid); TextDrawShowForPlayer(playerid,StationText[15]); WaitForBuf[playerid] = true; SetTimerEx("NonChangeRadio",5000,false,"i",playerid); SetTimerEx("HideStationTitle",3500,false,"i",playerid); return 1; } StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid,StationUrl[online - 1][0]); TextDrawShowForPlayer(playerid,StationText[online - 1]); WaitForBuf[playerid] = true; SetTimerEx("NonChangeRadio",5000,false,"i",playerid); SetTimerEx("HideStationTitle",3500,false,"i",playerid); return 1; } public OnPlayerKeyStateChange(playerid,newkeys,oldkeys) { if(newkeys == KEY_ACTION) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new veh = GetPlayerVehicleID(playerid); if(IsAVel(veh)) return 0; if(WaitForBuf[playerid]) return SendClientMessage(playerid,0xFF0000FF,"* Радиостанцию нельзя сменить в течении 5-ти секунд."); VehRadio[veh]++; if(VehRadio[veh] == 16) VehRadio[veh] = 0; PlayVehicleRadioForPlayer(playerid,VehRadio[veh]); for(new s = 1; s < 8; s++) { if(PassengerInCar[veh][s] != INVALID_PLAYER_ID) PlayVehicleRadioForPlayer(PassengerInCar[veh][s],VehRadio[veh]); } } } } if(newkeys == 132) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new veh = GetPlayerVehicleID(playerid); if(IsAVel(veh)) return 0; if(WaitForBuf[playerid]) return SendClientMessage(playerid,0xFF0000FF,"* Радиостанцию нельзя сменить в течении 5-ти секунд."); VehRadio[veh]--; if(VehRadio[veh] == -1) VehRadio[veh] = 15; PlayVehicleRadioForPlayer(playerid,VehRadio[veh]); for(new s = 1; s < 8; s++) { if(PassengerInCar[veh][s] != INVALID_PLAYER_ID) PlayVehicleRadioForPlayer(PassengerInCar[veh][s],VehRadio[veh]); } } } } return 0; } public NonChangeRadio(playerid) { WaitForBuf[playerid] = false; return 1; } public HideStationTitle(playerid) { for(new i = 0; i < 16; i++) TextDrawHideForPlayer(playerid,StationText[i]); return 1; } public IsAVel(vehicleid) { new model = GetVehicleModel(vehicleid); if(model == 481 || model == 509 || model == 510) return 1; return 0; }
теперь статистика не показывает вобще, когда переключаю радио появляется по середине на пару сек и исчезает, незнаю как исправить, помогите плизззз Автор - Ki$ Дата добавления - 20.10.2011 в 23:26:33