18.10.2015, 16:10
Sometimes the checkpoint is not placed on the player, the checkpoint is sometimes made incorrect.
Sometimes /cancelfind not work, does not delete checkpoint.
Sometimes /cancelfind not work, does not delete checkpoint.
Код HTML:
CMD:find(playerid, params[]) { if(pInfo[playerid][pJob] != 1) return SendClientMessage(playerid, COLOR_DARKGRAY,"You're not a detective!"); new targetid; new Float:x, Float:y, Float:z; if(sscanf(params,"u", targetid)) return SendSyntaxMessage(playerid, "/find [playerid/PartOfName]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_DARKGRAY,"Invalid player!"); GetPlayerPos(targetid, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 4.0); FindTimer[playerid] = SetTimerEx("findPlayer", 1000, 1, "ii", targetid, playerid); FindP[playerid] = 1; return 1; }
Код HTML:
forward findPlayer(targetid, playerid); public findPlayer(targetid, playerid) { if(FindP[playerid] == 1) { if(!IsPlayerConnected(targetid)) { DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~r~player has disconnected", 3000, 5); KillTimer(FindTimer[playerid]); FindTimer[playerid] = -1; FindP[playerid] = -1; return 1; } new Float:x, Float:y, Float:z; GetPlayerPos(targetid, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 4.0); } return 1; }
Код HTML:
CMD:cancelfind(playerid, params[]) { if(pInfo[playerid][pJob] != 1) return SendClientMessage(playerid, COLOR_DARKGRAY,"You're not a detective!"); if(FindP[playerid] == 1) { KillTimer(FindTimer[playerid]); FindTimer[playerid] = -1; DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~r~canceled find", 3000, 5); FindP[playerid] = -1; } return 1; }