18.04.2014, 12:16
This tutorial will show you how you can restrict different skin ID's for different players, or teams/factions. You will need the following for today's tutorial:
- SA:MP Pawn Package
- Basic Scripting Knowledge
Okay, so let's put our includes at the top, which will be...
Okay, so say we want to restrict skin id 280-289(cop skins) to gCops. We will do:
So basically what that does is detects if the skin id is equal to or higher than 280, and equal to or less than 289. So, now we can actually use it for a purpose. We will make a very simple /getskin command to show this off. We will use ZCMD for it.
But what if we only what the skin to be avaliable to a certain player name or IP? Then we can do this!
Basically, it will check if the skin ID is 0(CJ) and will then check if the player's name is "Evan Abagail(Evan_Abagail). If it's not it will return 0 and nothing will happen. If it is how-ever then it will give them the skin.
wiki.sa-mp.com/SetPlayerSkin
If you have any questions, or comments please either PM me or reply. Thanks, and hope this helps,
- Abagail
- SA:MP Pawn Package
- Basic Scripting Knowledge
Okay, so let's put our includes at the top, which will be...
pawn Code:
#include a_samp
pawn Code:
stock IsACopSkin(skinid)
{
if(skinid >= 280 && skinid <=289) return 1;
else return 0;
}
pawn Code:
CMD:getskin(playerid, params[])
{
new skinid;
if (sscanf(params, "d", skinid)) return SendClientMessage(playerid, -1, "USAGE: /getskin [skinid]");
if(IsACopSkin && gTeam[playerid] != TEAM_POLICE) return 0;
else {
SetPlayerSkin(playerid, skinid);
return 1;
}
return 1;
}
pawn Code:
stock CanGetSkin(playerid, skinid)
{
if(skinid == 0 && strcmp(playername, "Evan_Abagail", false) return 0;
else SetPlayerSkin(playerid, skinid)
return 1;
}
wiki.sa-mp.com/SetPlayerSkin
If you have any questions, or comments please either PM me or reply. Thanks, and hope this helps,
- Abagail