SA-MP Forums Archive
Get interior? - 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: Get interior? (/showthread.php?tid=109375)



Get interior? - [XST]O_x - 19.11.2009

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.


Re: Get interior? - Rzzr - 19.11.2009

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


Re: Get interior? - Correlli - 19.11.2009

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.
}



Re: Get interior? - Rzzr - 19.11.2009

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


Re: Get interior? - [XST]O_x - 19.11.2009

Oh,Thanks both of you guys!