Help with locking a skin - 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)
+--- Thread: Help with locking a skin (
/showthread.php?tid=548697)
Help with locking a skin -
FunnyBear - 01.12.2014
Hey,
I'm trying to lock the SWAT and Army skin to people with SWAT/Army level 1 or above (saved in the MySQL)
pawn Код:
if ( gTeam[ playerid ] == TEAM_SWAT )
{
if(pInfo[playerid][pSwat] < 1 )
{
SendClientMessage(playerid, RED, "You are not authorised to use this skin");
SetPlayerHealth(playerid, 0);
}
}
if ( gTeam[ playerid ] == TEAM_ARMY )
{
if(pInfo[playerid][pArmy] < 1 )
{
SendClientMessage(playerid, RED, "You are not authorised to use this skin");
SetPlayerHealth(playerid, 0);
}
}
That is under OnPlayerRequestSpawn, I added the SetPlayerHealth because it would just send a message once you've spawned.
I'm trying to set it so that if you don't have a SWAT/Army level it wont let you spawn when you click the 'Spawn' button when your choosing a player skin/class, it will send you a message saying you can't use it and it wont let you spawn. (Wont spawn the player) How could I add this?
Thanks
Re: Help with locking a skin -
Runn3R - 01.12.2014
pawn Код:
if ( gTeam[ playerid ] == TEAM_SWAT )
{
if(pInfo[playerid][pSwat] < 1 )
{
SendClientMessage(playerid, RED, "You are not authorised to use this skin");
return 0;
}
}
if ( gTeam[ playerid ] == TEAM_ARMY )
{
if(pInfo[playerid][pArmy] < 1 )
{
SendClientMessage(playerid, RED, "You are not authorised to use this skin");
return 0;
}
}
Try now.
Also if you have problems with something you don't need to open new topic just take a look at the WIKI:
https://sampwiki.blast.hk/wiki/OnPlayerRequestSpawn see it says there that if you return 0; that the player will not spawn.