Goto Enable and Disable
#1

Hello, in this script i want to do a goto command that can teleport player to another player, but if one player have goto disabled he can't teleport and receive teleport from another player.
This is the code:
if(strcmp(cmd, "/goto", true) == 0)
{
new string[128];
new tmp[128];
new Float: poscord[3];
new On[128];
new Off[128];
On = "On";
Off = "Off";
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /goto [playerid]");
else if(!IsPlayerConnected(strval(tmp))) return SendClientMessage(playerid,COLOR_RED,"Player non trovato"); // PLAYER NOT FOUNDED
else if(tmp = Off) return PlayerInfo[playerid][GOnOff] = 1; //i have the problem in this line
else if(tmp = On) return PlayerInfo[playerid][GOnOff] = 0; //i have the problem in this line
else if(PlayerInfo[strval(tmp)][GOnOff] == 1) return SendClientMessage(playerid,COLOR_RED,"Il giocatore ha disattivato il goton"); // the player have deactivate the goto
GetPlayerPos(strval(tmp),poscord[0],poscord[1],poscord[2]);
SetPlayerPos(playerid,poscord[0],poscord[1],poscord[2]);
GetPlayerName(strval(tmp),PlayerInfo[playerid][pname],MAX_PLAYER_NAME);
format(string,128,"ti sei teletrasportato da %s",PlayerInfo[playerid][pname]);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string) ;
return 1;
}
Reply


Messages In This Thread
Goto Enable and Disable - by SuperDJ - 10.09.2014, 17:42
Re: Goto Enable and Disable - by dusk - 10.09.2014, 17:46
Re: Goto Enable and Disable - by [XST]O_x - 10.09.2014, 17:48
Re: Goto Enable and Disable - by SuperDJ - 10.09.2014, 17:50
Re: Goto Enable and Disable - by SuperDJ - 10.09.2014, 17:56
Re: Goto Enable and Disable - by SuperDJ - 10.09.2014, 18:29

Forum Jump:


Users browsing this thread: 1 Guest(s)