#1

I have made a gate it moves properly when i use a cmd
but only skin 285 should be able to move it anyway i can do that?
Reply
#2

Somewhere in your command you would add an if statement to see if he is in skin 285.
Example
pawn Код:
CMD:gate(playerid,params[])
{
    if(GetPlayerSkin(playerid) != 285)
    {
        SendClientMessage(playerid,-1,"You are not allowed to open this gate.");
        return 1;
    }
    // rest of command here
}
Reply
#3

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
Somewhere in your command you would add an if statement to see if he is in skin 285.
Example
pawn Код:
CMD:gate(playerid,params[])
{
    if(GetPlayerSkin(playerid) != 285)
    {
        SendClientMessage(playerid,-1,"You are not allowed to open this gate.");
        return 1;
    }
    // rest of command here
}
pawn Код:
if (strcmp("/ogs", cmdtext, true, 10) == 0)
    {
    if(GetPlayerSkin(playerid) != 285)
    {
    MoveObject(gate, 2497.50, 2785.44, 11.27,3);
    else
    SendClientMessage(playerid, 0xAFAFAFAA,"i will put my text here");
       
        return 1;
    }
i did this but u see it gives me errors i want only id 285 to be able to open the gate so please make another pawn code and paste it in a reply like make the whole command see whats wrong with mine only 285 should be able to open the gate please help
Reply
#4

Try this, your indentation was off, and your code was wrong.
pawn Код:
if (strcmp("/ogs", cmdtext, true, 10) == 0)
{
    if(GetPlayerSkin(playerid) != 285)
    {
        SendClientMessage(playerid, 0xAFAFAFAA,"i will put my text here");
        return 1;
    }
    else
    {
        MoveObject(gate, 2497.50, 2785.44, 11.27,3);
    }
    return 1;
}
Reply
#5

Quote:

if (strcmp("/opengates", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid) != 285)
{
SendClientMessage(playerid, 0xAFAFAFAA,"Opening Gates.");
MoveObject(gate, 2497.50, 2785.44, 11.27,3);
return 1;
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA,"You are not allowed to move the gates");
}

return 1;
}

its the code..
Reply
#6

Quote:
Originally Posted by $$inSane
Посмотреть сообщение
its the code..
Код:
if (strcmp("/opengates", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid) != 285)
{
SendClientMessage(playerid, 0xAFAFAFAA,"Opening Gates.");
MoveObject(gate, 2497.50, 2785.44, 11.27,3);
return 1;
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA,"You are not allowed to move the gates");
}

return 1;
}
If you see that 2 guys helped him,why are you posting?
With your code,will open the gate if he is not with skin 285,
!= 285 Not equal.
Reply
#7

THX BOTH OF YOU
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)