[Help]This is bad [Help]
#1

When i type /lgate, it sends back the message saying"You dont have permisson to open this gate". Please help me.

And i am the police skin.

Код:
if(strcmp("/lgate", cmdtext) == 0)
    {
        if(GateState == 0) //If gate is closed
        {
            GateState = 1; //Gate = Open
            new pskin;
			if(pskin == 265 || pskin == 266 || pskin == 267 || pskin == 280 || pskin == 281 || pskin == 284 || pskin == 285 || pskin == 286 || pskin == 287 || pskin == 288)
			MoveObject(gate1, 2681.3083496094, 659.74249267578, 11.495002746582,3.0); //To open
		}
        else
        {
            if(GetPlayerSkin(playerid))return SendClientMessage(playerid,0xFF0000AA,"You dont have permisson to open this gate");
			GateState = 0; //Gate = Closed
			MoveObject(gate1, 2680.9462890625, 651.83990478516, 11.495002746582,3.0); //To closed
        }
  		return 1;
    }
Reply
#2

You need to wear/use one of those skin IDґs in your script.
Reply
#3

I know i wore all of them and i still get the message, even when i type /kill i get it.

Can someone fix my script because i tried all day and i could not do it
Reply
#4

Do you get any errors when you compile the script ?
Reply
#5

No errors

BTW can you add it and i will look at what you do and learn to do it next time?

Код:
if(GetPlayerSkin(playerid))return SendClientMessage(playerid,0xFF0000AA,"You dont have permisson to open this gate");
Reply
#6

Try it:
pawn Код:
if(strcmp("/lgate", cmdtext) == 0)
    {
        if(GateState == 0) //If gate is closed
        {
            GateState = 1; //Gate = Open
            new pskin=GetPlayerSkin(playerid);
        if(pskin == 265 || pskin == 266 || pskin == 267 || pskin == 280 || pskin == 281 || pskin == 284 || pskin == 285 || pskin == 286 || pskin == 287 || pskin == 288)
            {
                   MoveObject(gate1, 2681.3083496094, 659.74249267578, 11.495002746582,3.0); //To open
        }
            else
            {                      
                        return SendClientMessage(playerid,0xFF0000AA,"You dont have permisson to open this gate");
            }
       }
       else
       {
       GateState = 0; //Gate = Closed
       MoveObject(gate1, 2680.9462890625, 651.83990478516, 11.495002746582,3.0); //To closed
       return 1;
       }

        return 1;
    }
The local variable pskin don'ts defined for the skin of the player, then i set.
Reply
#7

It works when i open the gate, but when i try to close the gate i get the error "You dont have permisson to open this gate"
Reply
#8

Quote:
Originally Posted by zack3021
Посмотреть сообщение
It works when i open the gate, but when i try to close the gate i get the error "You dont have permisson to open this gate"
I edited the code, ident your code when paste in the pawno, here it's hard.
Reply
#9

I think that is gonna work. I'll try it
Reply
#10

Dude thanks i love you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)