18.01.2014, 17:40
I recently added this command:
But everytime I start to /mdctrack a player, it goes successfully with updates and all for about 9 SetTimerEx's then it crashes the client. Can anyone help?
Код:
CMD:mdcfind(playerid, params[]) { if(Faction[playerid] == 1 || Faction[playerid] == 2) { if(Find[playerid] == 0) { new targetid; new Float:x, Float:y, Float:z; if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Syntax: /mdcfind [id]"); if (targetid==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_NEWBIE,"You have entered an invalid player ID."); GetPlayerPos(targetid, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 5.0); SendClientMessage(playerid, COLOR_NEWBIE, "You have begun to track your target. Make your way to their location."); SetTimerEx("FindTimer", 1000, 1, "d", targetid); Find[playerid] = 1; } else if(Find[playerid] == 1) { DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_NEWBIE, "Stopped tracking."); Find[playerid] = 0; } } return SendClientMessage(playerid, COLOR_NEWBIE, "You don't have access to an MDC!"); }
Код:
public FindTimer(playerid) { new targetid; new Float:x, Float:y, Float:z; GetPlayerPos(targetid, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 5.0); SetTimerEx("FindTimer", 1000, 1, "d", targetid); Find[playerid] = 1; }