Allowing / Disallowing Goto
#1

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.
Reply
#2

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
Reply
#3

Thank You . I will post again if I get some problem with that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)