Dm Team
#1

Hi, im making a new server which is going to dm, i want to know how can i put the player in the cop team if he uses the copskins, Can anyone help/reply?
Reply
#2

Yes, ofcourse.

E.g you have a AddPlayerClass with the skin 285 (SWAT).
You could add this to your "OnPlayerRequestClass" callback:
pawn Код:
if(GetPlayerSkin(playerid) == 285)
    {
        GameTextForPlayer(playerid, "~b~S.W.A.T", 5000, 3);
        SetPlayerTeam(playerid, 0);
        return 1;
    }
Etc
Reply
#3

Thank you so much! But how can i then make all the cops the same?

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
Yes, ofcourse.

E.g you have a AddPlayerClass with the skin 285 (SWAT).
You could add this to your "OnPlayerRequestClass" callback:
pawn Код:
if(GetPlayerSkin(playerid) == 285)
    {
        GameTextForPlayer(playerid, "~b~S.W.A.T", 5000, 3);
        SetPlayerTeam(playerid, 0);
        return 1;
    }
Etc
Reply
#4

I do not understand your question, same what?
Reply
#5

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
I do not understand your question, same what?
the code you provided worked fine, but the problem is it only makes the skin 285 in cop team, i want from 280-289 skins to be in a cop team, so how will i do that?
Reply
#6

Add more skins.
You could try this:
pawn Код:
stock CopSkins(playerid)
{
    new skin = GetPlayerSkin(playerid);
    switch(skin)
    {
        case 285:
        {
            return true;
        }
        case 280:
        {
            return true;
        }
        case 281:
        {
            return true;
        }
        default:
        {
            return false;
        }
    }
return 1;
}
Reply
#7

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
Yes, ofcourse.
pawn Код:
GameTextForPlayer(playerid, "~b~S.W.A.T", 5000, 3);
I recommend a TextDraw instead. :]
Reply
#8

Edited Biesmen's code a bit

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(HasCopSkin(playerid))
    {
        GameTextForPlayer(playerid, "~b~S.W.A.T", 5000, 3);
        SetPlayerTeam(playerid, 0);
    }
    return 1;
}

stock HasCopSkin(playerid)
{
    switch(GetPlayerSkin(playerid))
    {
        case 280..281, 285: return 1;
        default: return 0;
    }
    return 0;
}
Reply
#9

PotH3Ad, thanks for that. But I just tried to do it on an easy way, because he's a beginner.

Seven_of_Nine:
I don't, creating unecessarily variables for a textdraw is just... unecessarily.
Reply
#10

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
PotH3Ad, thanks for that. But I just tried to do it on an easy way, because he's a beginner.

Seven_of_Nine:
I don't, creating unecessarily variables for a textdraw is just... unecessarily.
listen can i also make cops spawn on lspd stairs? i have a gRandomspawns and gCopplayerspawns
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)