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; }
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;
}
if(!RestrictedSkin(iSkin)) return SCP(playerid,"This skin is reserved for faction");
if(RestrictedSkin(iSkin)) return SCP(playerid,"This skin is reserved for faction");
stock RestrictedSkin(playerid, id) { switch(id) { case 124,129: { if(PlayerInfo[playerid][playerteam]<CORLE) return 0; } case 113,127: { if(PlayerInfo[playerid][playerteam]<WARLOCK) return 0; } } return 1; }
if(!RestrictedSkin(playerid,iSkin)) return SCP(playerid,"This skin is reserved for faction");
You can't check every players using that function.
Use this code for "RestrictedSkin" stock Код:
stock RestrictedSkin(playerid, id) { switch(id) { case 124,129: { if(PlayerInfo[playerid][playerteam]<CORLE) return 0; } case 113,127: { if(PlayerInfo[playerid][playerteam]<WARLOCK) return 0; } } return 1; } Код:
if(!RestrictedSkin(playerid,iSkin)) return SCP(playerid,"This skin is reserved for faction"); |
stock RestrictedSkin(id)
{
switch(id)
{
case 124,129,113,127: return 1;
default: return 0;
}
return 0;
}
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;
}
}
Because you are stating it wrong, you are saying that if the skin is NOT a restricted skin, then you don't allow him to.
To fix it, change this line: pawn Код:
pawn Код:
|
pawn Код:
|
You can't check every players using that function.
Use this code for "RestrictedSkin" stock Код:
stock RestrictedSkin(playerid, id) { switch(id) { case 124,129: { if(PlayerInfo[playerid][playerteam]<CORLE) return 0; } case 113,127: { if(PlayerInfo[playerid][playerteam]<WARLOCK) return 0; } } return 1; } Код:
if(!RestrictedSkin(playerid,iSkin)) return SCP(playerid,"This skin is reserved for faction"); |