SA-MP Forums Archive
/loc - 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: /loc (/showthread.php?tid=595243)



/loc - sanamalik400 - 30.11.2015

hi all. i wanna make /loc cmd for my gm for finding any player.. how i can do this?
any player can use this cmd.. plz help. loc for finding snipers .. weakness for sniper. and finding others for getting revenge..
sory for my bad english..i hope u understand


Re: /loc - Denying - 30.11.2015

Well. It's rather simple. All you have to do is make a command that requires the ID/name of a player and then just set a checkpoint to his location. You could also make it better by making a timer that would re-set the checkpoint every few seconds so that it updates the target's location.


EDIT: Should be smth like this (without timer. You need to have ZCMD and sscanf)

Код:
CMD:loc(playerid, params[])
{
    new target;

    if(sscanf(params, "u", target))
        return SendClientMessage(playerid, -1, "USAGE: /loc [id/PartOfName]");

    if(!IsPlayerConnected(target))
        return SendClientMessage(playerid, -1, "Error: Player not found.");

    if(target == playerid)
        return SendClientMessage(playerid, -1, "Error: You cannot locate yourself.");

    new Float:x, Float:y, Float:z;

    GetPlayerPos(target, x, y, z);

    SetPlayerCheckpoint(playerid, x, y, z, 5.0);

    return 1;
}



Re: /loc - sanamalik400 - 30.11.2015

thanks its pretty easy +rep to u,,