Disable Teleport command help.
#1

hi I need a /teleon and /teleoff command. this is what I have so far.


new bool: ReceiveInfo[MAX_PLAYERS];


dcmd_skroad(playerid, params[])
{
#pragma unused params
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,3893.8152, -1623.4252, 1442.5);
GameTextForPlayer(playerid,"SKROAD",2500,3);
CallRemoteFunction("XDynUpdateStart", "i", playerid);
SetCameraBehindPlayer(playerid);
///////////////////////////////
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(ReceiveInfo[i] == true)
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "TELE: %s has gone to Skroad (/skroad)", pName);
SendClientMessageToAll(COLOR_YELLOW, string);
}
}
}
}
...
if(strcmp(cmdtext, "/teleon", true) == 0)
{
if(ReceiveInfo[playerid] == false)
{
ReceiveInfo[playerid] = true;
SendClientMessage(playerid, COLOR_BASIC, "Now you will receive teleports of other players.");
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You already receive teleports!!");
}
return 1;
}
if(strcmp(cmdtext, "/teleoff", true) == 0)
{
if(ReceiveInfo[playerid] == true)
{
ReceiveInfo[playerid] = false;
SendClientMessage(playerid, COLOR_BASIC, "Now you won't receive teleports.");
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You already don't receive teleports!");
}
return 1;
}

when I do /teleon and /teleoff and try it it does work but when Receiveinfo is 0 after typing /teleoff it does not show that you teleported somewhere and it appears that everything worked. but it says Server Unknown Command. even though it worked.
Reply


Messages In This Thread
Disable Teleport command help. - by BP13 - 02.08.2009, 20:05
Re: Disable Teleport command help. - by whooper - 02.08.2009, 23:02
Re: Disable Teleport command help. - by yezizhu - 03.08.2009, 01:14
Re: Disable Teleport command help. - by BP13 - 03.08.2009, 05:45
Re: Disable Teleport command help. - by yezizhu - 03.08.2009, 06:29
Re: Disable Teleport command help. - by BP13 - 03.08.2009, 08:28
Re: Disable Teleport command help. - by yezizhu - 03.08.2009, 09:10
Re: Disable Teleport command help. - by ruarai - 03.08.2009, 09:29
Re: Disable Teleport command help. - by yezizhu - 03.08.2009, 09:56

Forum Jump:


Users browsing this thread: 8 Guest(s)