11.08.2011, 04:20
You keep specifying a length in strcmp, why?
Also your code is still messy and needs to be seriously cleaned, look at this cleaner example:
The reason it wasn't working is because you're telling strcmp (string compare) to match 6 cells in cmdtext with "/exit", when exist is only 5 characters and will never match with the cmdtext.
Like I said before, I don't see why you are specifying a length at all.
Also your code is still messy and needs to be seriously cleaned, look at this cleaner example:
pawn Код:
if (strcmp(cmdtext, "/enter", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 10, 290.7193,-1618.0544,33.1547))
{
SetPlayerPos(playerid, 288.745971,169.350997,1007.171875);
SetPlayerInterior(playerid, 3);
}
return 1;
}
if (strcmp(cmdtext, "/exit", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 10, 288.745971,169.350997,1007.171875))
{
SetPlayerPos(playerid, 288.745971,169.350997,1007.171875);
SetPlayerInterior(playerid, 0);
}
return 1;
}
Like I said before, I don't see why you are specifying a length at all.