How to make goto and get commands ? - 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: How to make goto and get commands ? (
/showthread.php?tid=478630)
How to make goto and get commands ? -
Le3aT - 30.11.2013
Hello
I need to know how to make goto and get commands if i am /rcon login [PASSWORD] I mean admin
Thanks
Re: How to make goto and get commands ? -
J4mmyHD - 30.11.2013
pawn Код:
CMD:goto(playerid, params[])
{
new playerb;
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "Your Not a Admin!");
if(sscanf(params, "u", playerb)) SendClientMessage(playerid, 0xFF0000FF, "USAGE: /goto [playerid]");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerb, x, y, z);
SetPlayerPos(playerid, x+1, y+1, z);
return 1;
}
pawn Код:
CMD:get(playerid, params[])
{
new playerb;
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "Your Not a Admin!");
if(sscanf(params, "u", playerb)) SendClientMessage(playerid, 0xFF0000FF, "USAGE: /gethere [playerid]");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerb, x+1, y+1, z);
return 1;
}
Re: How to make goto and get commands ? -
Stinged - 30.11.2013
Add this to the top of your script.
And download this:
https://sampforum.blast.hk/showthread.php?tid=91354
Commands:
PHP код:
CMD:get(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new id;
new Float:x, Float:y, Float:z;
if (!strlen(params)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /get [id]");
id = strval(params);
if (!IsPlayerConnected(id))SendClientMessage(playerid, 0xFF0000FF, "Player not found.");
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(id, x, y, z);
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "You need to be an admin to use this.");
}
return 1;
}
PHP код:
CMD:goto(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id;
new Float:x, Float:y, Float:z;
if (!strlen(params)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /goto [id]");
id = strval(params);
if (!IsPlayerConnected(id))SendClientMessage(playerid, 0xFF0000FF, "Player not found.");
GetPlayerPos(id, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "You need to be an admin to use this.");
}
return 1;
}