Posts: 206
Threads: 64
Joined: Jun 2012
Reputation:
0
Hello,
I wanna make a /goto [ID] cmd and which you can tele to other players.Well for example I type /goto 2 and ID 2 has typed /disablegotos . a message will come saying "This player has disabled goto" and if ID 2 types /enablegotos , I wil be able to tele to him. I wil rep
Posts: 206
Threads: 64
Joined: Jun 2012
Reputation:
0
i get many errors on both sides -_-
Posts: 20
Threads: 0
Joined: Sep 2014
pawn Код:
if(strcmp(cmdtext, "/goto", true) == 0)
{
new targetid;
if(sscanf(cmdtext[6], "u", targetid))//since in strcmp we cannot use params so i added this cmdtext[6]
{
return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]");
}
else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified.");
else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!");
else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them");
new Float: pos[3];
GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
return 1;
}
if(strcmp(cmdtext, "/toggoto", true) == 0)
{
if(gototog[playerid] == 0)
{
gototog[playerid] = 1;
SendClientMessage(playerid, -1, "Other players may not teleport to you now!");
}
else if(gototog[playerid] == 1)
{
gototog[playerid] = 0;
SendClientMessage(playerid, -1, "Other players may teleport to you now!");
}
return 1;
}
+REP if i helped you.