15.01.2010, 14:19
Hey guys i just start to create my own Speedo meter radar for the police. but i got it to work perfect accept that the message does not exist a long time only for like 3 seconds. i used GameTextForPlayer(playerid, HGG, 2000, 5); but then i thought that i should make like an update that it repeat same things all the time until i stop it, then i used gspeedo there to stop it. but when i try now it change an show my speed all the time but if i then do /radar [ID] the othere players speed come up but only for a litte lite 3 seconds. so now i need your help to fix this because i got no idea how to fix this.
Код:
if(strcmp(cmd, "/radar", true) ==0 ) { if(gTeam[playerid] == 2 || IsACop(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /radar [id]"); return 1; } giveplayerid = ReturnUser(tmp); if(GetDistanceBetweenPlayers(playerid,giveplayerid) < 200) { radarspeed(giveplayerid,playerid) } } return 1; }
Код:
public radarspeed(giveplayerid, playerid) { if(IsPlayerConnected(giveplayerid) && IsPlayerInAnyVehicle(giveplayerid)) { if(gSpeedo[playerid] == 2) { new HGG[256]; GetPlayerPos(giveplayerid,Xa,Ya,Za); KMH = floatsqroot(floatpower(floatabs(floatsub(Xa,Xb[giveplayerid])),2)+floatpower(floatabs(floatsub(Ya,Yb[giveplayerid])),2)+floatpower(floatabs(floatsub(Za,Zb[giveplayerid])),2)); KMH *= 6.2; //Yukseklik = Za; //format(HGG, sizeof(HGG), "~b~~h~~h~Name: ~w~%s~n~~g~~h~Speed: ~w~%0.0f km/h~n~~n~~y~~h~Fuel: ~w~%d ~n~~r~~h~Health: ~w~%.2f", ArIsim[GetVehicleModel(GetPlayerVehicleID(i))-400], KMH, Gas[vehicle], Can); format(HGG,sizeof(HGG),"~n~~n~~n~~n~~n~~n~~n~~g~Vehicle: ~w~%s - ~g~Speed: ~w~%0.0f km/h", ArIsim[GetVehicleModel(GetPlayerVehicleID(giveplayerid))-400], KMH); GameTextForPlayer(playerid, HGG, 2000, 5); } } }