/find - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /find (
/showthread.php?tid=591939)
/find -
norton2 - 18.10.2015
Sometimes the checkpoint is not placed on the player, the checkpoint is sometimes made incorrect.
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;
}
Re: /find -
N0FeaR - 30.10.2015
Try this
PHP код:
CMD:find(playerid, params[])
{
if(pInfo[playerid][pJob] != 1) return SendClientMessage(playerid, COLOR_DARKGRAY,"You're not a detective!");
new targetid, 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);
return 1;
}