How to add 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: How to add skin (
/showthread.php?tid=309569)
How to add skin -
Tamao_Serizawa - 08.01.2012
I have a roleplay server.I tried /setskin 0 i put the new skin id>>>example:/setskin 0 5(new skin)
Its says invalid skin.How can i add it to my server pack.I have 0.3d R2 server and it say Invalid Skin!.
Pm me and help me add it to my GM.Not
Re: How to add skin -
Aprezt - 08.01.2012
Update your server to 0.3d. Because when you update then you can use new skins!
Re: How to add skin -
Tamao_Serizawa - 08.01.2012
already lol.
Re: How to add skin -
Aprezt - 08.01.2012
AAa sorry i watch that is a 0.3c... my bad... Mby you show the CMD ??
Re: How to add skin -
Tamao_Serizawa - 08.01.2012
pawn Код:
if(strcmp(cmd, "/setskin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [playerid/PartOfName] [skin]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerNPC(giveplayerid)) return 1;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [playerid/PartOfName] [skin]");
return 1;
}
new skin;
skin = strvalEx(tmp);
if(skin < 0 || skin > 299) { SendClientMessage(playerid, COLOR_GREY, " Skin can't be below 0 or above 299 !"); return 1; }
if(IsInvalidSkin(skin)) { SendClientMessage(playerid, COLOR_GREY, " Invalid Skin !"); return 1; }
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
PlayerInfo[giveplayerid][pModel] = skin;
SetPlayerSkin(giveplayerid, skin);
format(string, sizeof(string), " That players Skin was set to %d !", skin);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player !", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Re: How to add skin -
Tamao_Serizawa - 08.01.2012
Is this the problem?
pawn Код:
// Player Class's
for(new i = 0; i <= sizeof(PedSkins)-1; i++)
{
AddPlayerClass(PedSkins[i][0],982.1890,-1624.2583,14.952,90,-1,-1,-1,-1,-1,-1);
}
Re: How to add skin -
Aprezt - 08.01.2012
Mmm mby yes just copy compile and test 
Re: How to add skin -
Jochemd - 08.01.2012
Why do you copy things out of the Godfather? These are really, REALLY inefficient! There are much better methods available, such as ZCMD + sscanf (a great combination).
pawn Код:
CMD:setskin(playerid,params[])
{
new giveplayerid,skin;
if(!sscanf(params,"ud",giveplayerid,skin))
{
if(skin < 0 || skin > 299) return SendClientMessage(playerid, COLOR_GREY, " Skin can't be below 0 or above 299 !");
if(PlayerInfo[playerid][pAdmin] >= 2)
{
PlayerInfo[giveplayerid][pModel] = skin;
SetPlayerSkin(giveplayerid, skin);
format(string, sizeof(string), " That players Skin was set to %d !", skin);
SendClientMessage(playerid, COLOR_GRAD1, string);
return 1;
}
else return SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
else return SendClientMessage(playerid,COLOR_GRAD1,"Usage: /setskin [ID].");
}
I can only recommend you to use this, then it might work! Do you see the difference between Godfather code and this one I made out of this code for you?
Re: How to add skin -
Tamao_Serizawa - 08.01.2012
THat is not GF..lol...btw i dont realize if it is GF cuz its my friend work..he make the script for me.