Detecting - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Detecting (
/showthread.php?tid=186037)
Detecting -
SampStunta - 27.10.2010
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
Re: Detecting -
SampStunta - 27.10.2010
That's true, I'll try a few things at the moment.
Re: Detecting -
Kyle - 27.10.2010
Onplayerrequestspawn
pawn Код:
new skin = GetPlayerSkin(playerid);
if(skin == copskin)
{
SendClientMessage(playerid,COLOR_BLUE,"You cannot spawn as this skill, Choose Another One!");
return 0;
}
Re: Detecting -
randomkid88 - 27.10.2010
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;
}