Detecting
#1

Hey guys, SampStunta here.
I'm just wondering...

What is the line so that my GM detects the part-of-player-name which will have [SAPD]
and so that they're automatically known to be a cop and set them to the proper cop skin?

All I need for now is the detecting part.
The rest, I'll add in.

Thanks
-SampStunta
Reply
#2

That's true, I'll try a few things at the moment.
Reply
#3

Onplayerrequestspawn

pawn Код:
new skin = GetPlayerSkin(playerid);

if(skin == copskin)
{
    SendClientMessage(playerid,COLOR_BLUE,"You cannot spawn as this skill, Choose Another One!");
    return 0;
}
Reply
#4

Look for the [SAPD] in their name using strfind, and then you can use it to set their team and skin.
pawn Код:
OnPlayerConnect(playerid)
{
     new pName[24];
     GetPlayerName(playerid, pName, sizeof(pName));
     if(strfind(pName, "[SAPD]", false) != -1)
     {
       // set skin and team here
     }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)