SA-MP Forums Archive
Command Screwup - 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: Command Screwup (/showthread.php?tid=197156)



Command Screwup - Matthew_Johnston - 08.12.2010

I Dont Know if its just my CMDS. but when I Try to do a Command, it does the Other One.

/kill was /enter and /enter was /kill.

Heres my Code:
Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true))
{
SetPlayerHealth(playerid, 0.00);
return 1;
}
if (strcmp("/enter", cmdtext, true))
{
if(IsPlayerInRangeOfPoint(playerid, 5, 2446.0437,2376.1707,12.1635))
{
SetPlayerPos(playerid, 384.808624,173.804992,1008.382812);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
}
return 0;
}

I Think its quite possibly a 0.3c Bug, Cuz Ive never seen this before.


Re: Command Screwup - Joe Staff - 08.12.2010

You forgot that strcmp returns 0 when it succeeds

If(strcmp("/enter",cmdtext,true)==0)


Re: Command Screwup - Matthew_Johnston - 08.12.2010

Oh Thanks