16.08.2015, 15:12
Hello guys.
Well i was trying to make RestrictedSkins for families but its not working.
Players can select skins at clothes from that i did already at Cases.
Here is my script.
Clothes command Where skins that i've reserved wouldnt be available here.
/clothes cmd is onlies way to set player skins.
Well i was trying to make RestrictedSkins for families but its not working.
Players can select skins at clothes from that i did already at Cases.
Here is my script.
Код HTML:
stock RestrictedSkin(id) { switch(id) { case 124,129: { new playerid; if(PlayerInfo[playerid][playerteam]<CORLE)return SendClientError(playerid,"This skin is reserved for faction"); return 1; } case 113,127: { new playerid; if(PlayerInfo[playerid][playerteam]<WARLOCK)return SendClientError(playerid,"This skin is reserved for faction"); return 1; } } return 1; }
Clothes command Where skins that i've reserved wouldnt be available here.
/clothes cmd is onlies way to set player skins.
PHP код:
COMMAND:clothes(playerid, params[])
{
new tmpid=IsPlayerInBiz(playerid);
if(tmpid!=-1 && biz[tmpid][biztype]==9 && GetPlayerVirtualWorld(playerid)==biz[tmpid][vbiz])
{
new iSkin;
if(sscanf(params, "d", iSkin)) return SCP(playerid, "[skin id]");
if(!IsValidSkin(iSkin)) return SCP(playerid, "[skin id]");
if(!RestrictedSkin(iSkin)) return SCP(playerid,"This skin is reserved for faction");
new query[250], pname[25];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "UPDATE PlayerInfo SET Skin=%d WHERE user='%s'", iSkin, pname);
mysql_query(query);
SetPlayerSkin(playerid, iSkin);
PlayerInfo[playerid][Skin] = iSkin;
return 1;
}