SA-MP Forums Archive
A few basic errors. - 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)
+--- Thread: A few basic errors. (/showthread.php?tid=360211)



A few basic errors. - Rabbayazza - 16.07.2012

I have a few errors, which I believe will be simple enough to fix.

pawn Код:
if(!strcmp(cmdtext, "/enter", true))
        {
            if(IsPlayerInRangeOfPoint(playerid, 10, 1341.5411, -1675.3422, 17.7164))
        {
            SetPlayerPos(playerid, 963.70001221, -53.29999924, 1000.70001221);
            SetPlayerInterior(playerid, 3);
        }
            return 1;
        }

    if(!strcmp(cmdtext, "/exit", true))
        {
            if(IsPlayerInRangeOfPoint(playerid, 10, 963.70001221, -53.29999924, 1000.70001221))
        {
            SetPlayerPos(playerid, 1341.5411, -1675.3422, 17.7164);
            SetPlayerInterior(playerid, 0);
        }
            return 1;
        }
The /enter command works perfectly, but upon typing /exit nothing happens, why is this?


also

pawn Код:
Create3DTextLabel("Please press /enter", 0xEF994300, 1341.5411, -1675.3422, 17.7164, 10, 0, 1);
    Create3DTextLabel("Please press /exit", 0xEF994300, 963.70001221, -53.29999924, 1000.70001221, 10, 0, 1);
Why aren't these showing up in my server?

Thank you.


Re: A few basic errors. - hansen111 - 16.07.2012

Could be you are not near the coords you provided, try this to see if you get the message saying you are not near the exit point:

Код:
if(!strcmp(cmdtext, "/enter", true))        {            

	if(IsPlayerInRangeOfPoint(playerid, 10, 1341.5411, -1675.3422, 17.7164)) {            
		SetPlayerPos(playerid, 963.70001221, -53.29999924, 1000.70001221);            
		SetPlayerInterior(playerid, 3);        
	}            
	else  SendClientMessage(playerid, COLOR_GREEN, "You are not near any enter points");
	
return 1;        
}    


if(!strcmp(cmdtext, "/exit", true))        {            
	if(IsPlayerInRangeOfPoint(playerid, 10, 963.70001221, -53.29999924, 1000.70001221)) {
            SetPlayerPos(playerid, 1341.5411, -1675.3422, 17.7164);            
	    SetPlayerInterior(playerid, 0);        
	}            
	else  SendClientMessage(playerid, COLOR_GREEN, "You are not near any exit points");

return 1;        
}
Regarding the 3d textdraws it could also be that the coords are wrong, i cant tell from what you posted.


Re: A few basic errors. - Rabbayazza - 16.07.2012

I got the /exit working, turns out a filterscript was interfering with it.

Still clueless as to why the labels aren't working.


Re: A few basic errors. - Rabbayazza - 16.07.2012

Okay, update on the text labels.

I now have

pawn Код:
new Text3D:Enter;
new Text3D:Exit;
pawn Код:
Enter = Create3DTextLabel("Please press /enter", 0xEF994300, 1341.5411, -1675.3422, 17.7164, 10, -1, 0);
    Exit = Create3DTextLabel("Please press /exit", 0xEF994300, 963.70001221, -53.29999924, 1000.70001221, 10, -1, 0);
    Update3DTextLabelText(Text3D:Enter, 0xEF994300, "Please press /enter");
    Update3DTextLabelText(Text3D:Exit, 0xEF994300, "Please press /exit");
but it still doesn't show up, why?