Allowing / Disallowing Goto - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Allowing / Disallowing Goto (
/showthread.php?tid=121969)
Allowing / Disallowing Goto -
Spinno - 19.01.2010
Hey. Sorry for making a new topic, but I couldnt find anything helpful with search tool.
Anyways, anyone knows how to make a /Goto ID command, like the LADMIN's goto but other players could /allowgoto or /disallowgoto so, if they does not want someone gotos to them, it will block gotoing to the certain player.
Thanks.
Re: Allowing / Disallowing Goto -
actiwe - 19.01.2010
pawn Код:
//top of script
#include <zcmd>
new allowgoto[MAX_PLAYERS];
//OnPlayerConnect
allowgoto[playerid] = 0;
//commands
CMD:allowgoto(playerid, params[])
{
#pragma unused params
if (allowgoto == 1) return SendClientMessage(playerid, COLOR_GREY, "You've already allowed teleport");
allowgoto = 1;
SendClientMessage(playerid, COLOR_GREY, You've allowed teleporting);
}
CMD:disallowgoto(playerid, params[])
{
#pragma unused params
if (allowgoto == 0) return SendClientMessage(playerid, COLOR_GREY, "You've already disallowed teleport");
allowgoto = 0;
SendClientMessage(playerid, COLOR_GREY, You've disallowed teleporting);
}
Something like that ?
/edit forgot the /goto also
pawn Код:
CMD:goto(playerid, params[])
{
new others, Float:X, Float:Z, Float:Y;
if(sscanf(params "u" otherid)) return SendClientMessage(playerid, COLOR_GREY, " USAGE:/goto PLAYERID");
if (allowgoto[otherid] == 1)
{
GetPlayerPos(otherid, x, y, z);
SetPlayerPos(playerid, x+2 , y, z);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "This player has enable teleportation block");
}
I remade them into zcmd. Search under includes for zcmd and also sscanf
Re: Allowing / Disallowing Goto -
Spinno - 19.01.2010
Thank You

. I will post again if I get some problem with that.