GetPlayerInterior wtf
#1

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.
Reply
#2

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
Reply
#3

What does the ! do?
Reply
#4

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

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

It worked :P I cannot thank you enough!
Reply
#7

What did you do?
Reply
#8

Used PlayerToPoint
Reply
#9

Код:
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)