09.05.2010, 16:38
Hello, I got a problem with my command when i uses it it crashes the server for me and i can't find the reason why it crashes:P
CMD:
CMD:
Код:
dcmd_vhotwire(playerid, params[]) { SetTimerEx("wiretimer", 2000, false, "%d", playerid); new text[256]; new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); for(new i; i < MAX_PLAYERS; i++) { format(text,sizeof(text),"*%s tries to hotwire the vehicle.",PlayerName(playerid)); if(IsPlayerInRangeOfPoint(i,7.0,x,y,z)) { SendClientMessage(i, Purple, text); } } return 1; } forward wiretimer(playerid); public wiretimer(playerid) { new text[256]; new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); for(new i = 0; i < MAX_PLAYERS; i++) { if(random(3) != 1) { format(text,sizeof(text),"*%s fails to hotwire the vehicle.",PlayerName(playerid)); if(IsPlayerInRangeOfPoint(i,7.0,x,y,z)) { SendClientMessage(i, Red, text); } return 1; } format(text,sizeof(text),"*%s success to hotwire the vehicle.",PlayerName(playerid)); iVehicle[GetPlayerVehicleID(playerid)][1][1] = 1; TogglePlayerControllable(playerid,1); if(IsPlayerInRangeOfPoint(i,7.0,x,y,z)) { SendClientMessage(i, Green, text); } } return 1; }