05.06.2010, 16:17
Hey,i have problem with speedo,if i go to /carshop,i want it to disable the speedo,but it wont,i dont know how to disable it,i tried it but i couldnt,heres the code,thanks
Код:
forward Speedometer(); public Speedometer() { new Float:maxspeed = 175.0; new plname[MAX_PLAYER_NAME]; new string[256]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { CarShopping[i] = true; } } for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(GetPlayerState(i) == 2) { GetPlayerPos(i, TelePos[i][3], TelePos[i][4], TelePos[i][5]); if(TelePos[i][5] > 550.0) { TelePos[i][0] = 0.0; TelePos[i][1] = 0.0; } if(TelePos[i][0] != 0.0) { new Float:xdist = TelePos[i][3]-TelePos[i][0]; new Float:ydist = TelePos[i][4]-TelePos[i][1]; new Float:sqxdist = xdist*xdist; new Float:sqydist = ydist*ydist; new Float:distance = (sqxdist+sqydist)/31; if(gSpeedo[i] == 2) { new vehicle = GetPlayerVehicleID(i); new model = GetVehicleModel(vehicle); if(model == 481 || model == 509 || model == 510) { return 0; } if(distance <10) { format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~>~~r~mph : ~w~%.0f ~r~ Fuel: ~w~ %d~<~",distance, Fuel[vehicle]); } if(distance > 10 && distance < 100) { format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~>~~r~mph : ~w~%.0f ~r~ Fuel: ~w~ %d~<~",distance, Fuel[vehicle]); } if(distance > 100) { format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~>~~r~mph : ~w~%.0f ~r~ Fuel: ~w~ %d~<~",distance, Fuel[vehicle]); } GameTextForPlayer(i, string, 2000, 5); } if(distance > maxspeed) { GetPlayerName(i, plname, sizeof(plname)); format(string, 256, "NC-RP Anticheat - %s[%d] speed is - %.0f mph",plname, i ,distance); Adminmsg(string); } } if(TelePos[i][5] < 550.0 && TelePos[i][3] != 0.0) { TelePos[i][0] = TelePos[i][3]; TelePos[i][1] = TelePos[i][4]; } } } } return 1; }