Commands
#1

Hi,
How can I make commands for specific "skins" example just only policeman or guards can use a specific command?
Reply
#2

Use GetPlayerSkin and check if he is wearing a police skin or not.

Links:
------
GetPlayerSkin - Wiki
Skin List - Wiki
Reply
#3

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Use GetPlayerSkin and check if he is wearing a police skin or not.

Links:
------
GetPlayerSkin - Wiki
Skin List - Wiki
Thanks, But I'm still beginner. So could you paste a example code. I know only how to add commands but not for specified skin. :P
Reply
#4

Quote:
Originally Posted by Swc20
Посмотреть сообщение
Thanks, But I'm still beginner. So could you paste a example code. I know only how to add commands but not for specified skin. :P
pawn Код:
playerskin = GetPlayerSkin(playerid);
taken from wiki
Reply
#5

Check samp wiki main page for any help you need they will provide you with all help.

if i ever helped u please + rep becuz i need to advertise my server.
Reply
#6

Quote:
Originally Posted by Xtreme_playa
Посмотреть сообщение
pawn Код:
playerskin = GetPlayerSkin(playerid);
taken from wiki
I need help with another thing. I get this error:
pawn Код:
: warning 217: loose indentation
when i wirte:

pawn Код:
public OnPlayerSpawn(playerid)
{
    playerskin = GetPlayerSkin(playerid);
        if(playerskin == 1)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Skin ID 4");
        }
        if(playerskin == 2)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Skin ID 2");
        }
        if(playerskin == 3)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Skin ID 3");
        }
        if(playerskin == 4)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Skin ID 4");
        }
        if(playerskin == 5)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Skin ID 5");
        }
        if(playerskin == 6)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Skin ID 6");
        }
    return 1;
}
Reply
#7

pawn Код:
public OnPlayerSpawn(playerid)
{
    playerskin = GetPlayerSkin(playerid);
    if(playerskin == 1)
    {
        SendClientMessage(playerid, 0xFF0000FF, "Skin ID 4");
    }
    if(playerskin == 2)
    {
        SendClientMessage(playerid, 0xFF0000FF, "Skin ID 2");
    }
    if(playerskin == 3)
    {
        SendClientMessage(playerid, 0xFF0000FF, "Skin ID 3");
    }
    if(playerskin == 4)
    {
        SendClientMessage(playerid, 0xFF0000FF, "Skin ID 4");
    }
    if(playerskin == 5)
    {
        SendClientMessage(playerid, 0xFF0000FF, "Skin ID 5");
    }
    if(playerskin == 6)
    {
        SendClientMessage(playerid, 0xFF0000FF, "Skin ID 6");
    }
    return 1;
}
Reply
#8

Nothing
Reply
#9

pawn Код:
playerskin = GetPlayerSkin( playerid );
if( playerskin >= 5 || playerskin <= 7 )
{
    // The skin is 5 or 6 or 7
}
Also with cases:
pawn Код:
playerskin = GetPlayerSkin( playerid );
switch( playerskin )
{
    case 5 .. 7: //the skins are from 5 to 7 (5, 6, 7)
}
Or if it's like 5, 6, 8 then you have to use it
pawn Код:
playerskin = GetPlayerSkin( playerid );
if( playerskin == 5 || playerskin == 6 || playerskin == 8 )
{
    // The skin is 5 or 6 or 8
}
But you can use also cases.
pawn Код:
playerskin = GetPlayerSkin( playerid );
switch( playerskin )
{
    case 5, 6, 8: // the skin is 5 or 6 or 8
}
Edit: Erm.. You asked me and then edited the post to
Quote:
Originally Posted by Swc20
Посмотреть сообщение
Nothing
Reply
#10

Quote:
Originally Posted by Dwane
Посмотреть сообщение
pawn Код:
playerskin = GetPlayerSkin( playerid );
if( playerskin >= 5 || playerskin <= 7 )
{
    // The skin is 5 or 6 or 7
}
Also with cases:
pawn Код:
playerskin = GetPlayerSkin( playerid );
switch( playerskin )
{
    case 5 .. 7: //the skins are from 5 to 7 (5, 6, 7)
}
Or if it's like 5, 6, 8 then you have to use it
pawn Код:
playerskin = GetPlayerSkin( playerid );
if( playerskin == 5 || playerskin == 6 || playerskin == 8 )
{
    // The skin is 5 or 6 or 8
}
But you can use also cases.
pawn Код:
playerskin = GetPlayerSkin( playerid );
switch( playerskin )
{
    case 5, 6, 8: // the skin is 5 or 6 or 8
}
Edit: Erm.. You asked me and then edited the post to
How to make random camera positions, I mean that the camera changes view every 2 second and after 3 views it goes to player skin selection?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)