13.08.2012, 19:43
pawn Код:
CMD:saveskin(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 1 && PlayerInfo[playerid][LoggedIn] == 1) {
if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /saveskin [skinid]");
new string[128], SkinID = strval(params);
if((SkinID == 0)||(SkinID == 7)||(SkinID >= 9 && SkinID <= 41)||(SkinID >= 43 && SkinID <= 64)||(SkinID >= 66 && SkinID <= 73)||(SkinID >= 75 && SkinID <= 85)||(SkinID >= 87 && SkinID <= 118)||(SkinID >= 120 && SkinID <= 148)||(SkinID >= 150 && SkinID <= 207)||(SkinID >= 209 && SkinID <= 264)||(SkinID >= 274 && SkinID <= 288)||(SkinID >= 290 && SkinID <= 299))
{
dUserSetINT(PlayerName2(playerid)).("FavSkin",SkinID);
format(string, sizeof(string), "You have successfully saved this skin (ID %d)",SkinID);
SendClientMessage(playerid,yellow,string);
SendClientMessage(playerid,yellow,"Type: /useskin to use this skin when you spawn or /dontuseskin to stop using skin");
dUserSetINT(PlayerName2(playerid)).("UseSkin",1);
return CMDMessageToAdmins(playerid,"SAVESKIN");
} else return SendClientMessage(playerid, green, "ERROR: Invalid Skin ID");
} else return SendClientMessage(playerid,red,"ERROR: You must be an administrator to use this command");
}
CMD:useskin(playerid,params[]) {
#pragma unused params
if(PlayerInfo[playerid][Level] >= 1 && PlayerInfo[playerid][LoggedIn] == 1) {
dUserSetINT(PlayerName2(playerid)).("UseSkin",1);
SetPlayerSkin(playerid,dUserINT(PlayerName2(playerid)).("FavSkin"));
return SendClientMessage(playerid,yellow,"Skin now in use");
} else return SendClientMessage(playerid,red,"ERROR: You must be an administrator to use this command");
}
CMD:dontuseskin(playerid,params[]) {
#pragma unused params
if(PlayerInfo[playerid][Level] >= 1 && PlayerInfo[playerid][LoggedIn] == 1) {
dUserSetINT(PlayerName2(playerid)).("UseSkin",0);
return SendClientMessage(playerid,yellow,"Skin will no longer be used");
} else return SendClientMessage(playerid,red,"ERROR: You must be an administrator to use this command");
}