11.08.2011, 03:56
Your code makes no sense at all, I seriously suggest you start reading the PAWN documentation over at CompuPhase's website section for PAWN.
First of all, you're comparing two arrays and specifying a length of 1, so basically all you're doing is checking for / and then that piece of code will run, why specify a length at all? Then your IsPlayerInRangeOfPoint is doing absolutely nothing, it's just sitting there, then you have an else if statement which can never be reached because it's the exact same check as the first if statement in that structure.
Here is an example of fixed code:
Now you should be able to figure out the rest for yourself, but like I said earlier, start learning PAWN and basic programming first.
First of all, you're comparing two arrays and specifying a length of 1, so basically all you're doing is checking for / and then that piece of code will run, why specify a length at all? Then your IsPlayerInRangeOfPoint is doing absolutely nothing, it's just sitting there, then you have an else if statement which can never be reached because it's the exact same check as the first if statement in that structure.
Here is an example of fixed code:
pawn Код:
if(!strcmp(cmdtext, "/enter", true))
{
if(IsPlayerInRangeOfPoint(playerid, 290.7193,-1618.0544,33.1547,179.7500))
{
SetPlayerPos(playerid, 288.745971,169.350997,1007.171875);
SetPlayerInterior(playerid, 3);
}
else SendClientMessage(playerid, COLOR_YELLOW, "You can't enter");
}