Get interior?
#1

Hey.
I'm trying to make a command,Something like /Cop,Or /Officer.
And i'm trying to do that you can use the command only on the LSPD interior(Which is 6).
And i've tried to do something like
if GetPlayerInterior(playerid) = 6 Well it didn't work 0.0
I Need that if the player is not in the interior it will SendClientMessage "You have to be in LSPD Interior to become an officer."
I've tried:
pawn Код:
if (strcmp("/Officer", cmdtext, true, 10) == 0)
    {
        if GetPlayerInterior(playerid) = 6
        {
        SendClientMessage(playerid,Red,"You are now an officer!");
        SetPlayerSkin(playerid,280);
        }
        else
        {
        SendClientMessage(playerid,Red,"You have to be in LSPD Interior to become an officer.");
        }
    return 1; //Sorry the indentation fucked up...
Well it gives me some errors.
I Won't show you the errors because i think it's un-needed,Because you can already know that the mistake is in if GetPlayerInterior(playerid) = 6
But you know what i've meant.
Help appreciated.Thanks in advance.
Reply
#2

if GetPlayerInterior(playerid) = 6
Should be:
if(GetPlayerInterior(playerid)) == 6
Or something like that.
The 2 == and the ()
Reply
#3

Quote:
Originally Posted by [ST
DutchBas ]
if GetPlayerInterior(playerid) = 6
Should be:
if(GetPlayerInterior(playerid)) == 6
Wrong.

Correct:
pawn Код:
if(GetPlayerInterior(playerid) == 6)
{
  // your code.
}
Reply
#4

Oh yeah i did it fast :P
Don_Corelli is right.
Reply
#5

Oh,Thanks both of you guys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)