10.03.2013, 06:07
Hi guys,
I am new in scripting and I need help for this command.I write in server /setlevel 0 5 and return UNKNOW COMMAND.
I am new in scripting and I need help for this command.I write in server /setlevel 0 5 and return UNKNOW COMMAND.
Код:
dcmd_setlevel(playerid,params[]) { new id,lvl,string[128]; if(PInfo[playerid][Level] < 5) return SendClientMessage(playerid,red,error); if(sscanf(params,"ui",id,lvl)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/setlevel <id> <level>"); if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,red,notconnected); format(string,sizeof(string),"*** %s(ID:%d) has set your admin level to %d!",GetPName(playerid),playerid,lvl); SendClientMessage(id,green,string); if(PInfo[id][Level] < lvl) { GameTextForPlayer(id,"~g~~h~~h~Promoted!",4000,3); PlaySound(id,1057); } if(PInfo[id][Level] > lvl) { GameTextForPlayer(id,"~r~~h~Demoted!",4000,3); PlaySound(playerid,1085); } format(string,sizeof(string),"*** You've set %s(ID:%d)'s level to %d!",GetPName(id),id,lvl); SendClientMessage(playerid,green,string); PInfo[id][Level] = lvl; return 1; }