Help With My /Find command.
#1

Hi.
My command works fine, but I have a problem.
When I do /find ID..
It shows a checkpoint, but when the player moves to anywhere the checkpoint is in the same place.
There is a way that the checkpoint follows the player?

PHP код:
CMD:find(playeridparams[])
{
new 
targetid; new Float:xFloat:yFloat:z;
    if(
sscanf(params,"u"targetid)) return SendClientMessage(playerid, -1"Usage: /find (ID)");
    
GetPlayerPos(targetidxyz);
    
SetPlayerCheckpoint(playeridxyz3.0);
    return 
1;

Reply
#2

Use timers
pawn Код:
CMD:find(playerid, params[])
{
    new targetid; new Float:x, Float:y, Float:z;
    if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, -1, "Usage: /find (ID)");
    GetPlayerPos(targetid, x, y, z);
    SetPlayerCheckpoint(playerid, x, y, z, 3.0);

    SetTimerEx("findPlayer", 1000, 1, "ii", targetid, playerid);
    return 1;
}  

forward findPlayer(playerid, forplayerid);
public findPlayer(playerid, forplayerid)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetPlayerCheckpoint(forplayerid, x, y, z, 3.0);
    return 1;
}
That's a basic example, you'll still need to kill the timer accordingly.
Reply
#3

Make a value and activate then kill , continue this
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)