SA-MP Forums Archive
GetPlayerInterior wtf - 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: GetPlayerInterior wtf (/showthread.php?tid=69362)



GetPlayerInterior wtf - GTA_Rules - 17.03.2009

Hi,

I really really don't get what I'm doing wrong.

Код:
		if(strcmp(cmd, "/weapmenu", true) == 0) {
 		if(GetPlayerInterior(playerid)== 7)
 		{
 		ShowMenuForPlayer(Weapons,playerid);
 		SendClientMessage(playerid, COLOR_WHITE,"WHY ISNT THIS MENU WORKING");
		}
		if(GetPlayerInterior(playerid)==0)
             {
 		SendClientMessage(playerid, COLOR_GREY,"You must be in /ammunation to use this command!");
 		}
  	return 1;
    }
This should only display when he's in ammunation (which is interior ID : 7).

When I type /weapmenu in interior 0 (outside) it says what it should. (You must be blabla).
Altough when I'm in /ammunation it's not doing anything. Nor showing the menu, nor showing the message.

Here's a little screenshot:



NOTE: The grey message and the you will be teleported in 5 seconds were sent when I was in the normal world (this isn't a bug).

Please help me!
Thanks

EDIT: The intendation keeps fucking when I post this.


Re: GetPlayerInterior wtf - thuron - 17.03.2009

i think you should save your position in the interior, and add
Код:
if(PlayerToPoint(DISTANCE,playerid,X, Y, Z))
and then the menu, or
Код:
if(!PlayerToPoint(DISTANCE,playerid,X, Y, Z))
and then an message that you have to be in there. (check the ! before playertopoint)

i hope it works


Re: GetPlayerInterior wtf - GTA_Rules - 17.03.2009

What does the ! do?


Re: GetPlayerInterior wtf - MenaceX^ - 17.03.2009

Don't make more if statement, you can simply do else instead.


Re: GetPlayerInterior wtf - thuron - 17.03.2009

it makes playertopoint to if playerisNOTto point, symply with a !


Re: GetPlayerInterior wtf - GTA_Rules - 18.03.2009

It worked :P I cannot thank you enough!


Re: GetPlayerInterior wtf - MenaceX^ - 18.03.2009

What did you do?


Re: GetPlayerInterior wtf - GTA_Rules - 18.03.2009

Used PlayerToPoint


Re: GetPlayerInterior wtf - CruncH - 18.03.2009

Код:
if(strcmp(cmd, "/weapmenu", true) == 0) {
 		if(GetPlayerInterior(playerid) != 7 )return SendClientMessage(playerid, COLOR_GREY,"You must be in /ammunation to use this command!");
  	return ShowMenuForPlayer(Weapons,playerid);
    }
try that.