dcmd_set(playerid, params[])
{
new aitem;
new id;
new amount;
if(PlayerInfo[playerid][AdminLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params,"sud",aitem,id,amount)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /set (/help sets) (ID/Partial Name) (Amount/Level/Faction)");
new item[128];
format(item,sizeof(item),"%s",aitem);
if(!strcmp(item,"admin",true))
{
if(PlayerInfo[playerid][AdminLevel] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(IsPlayerConnected(id))
{
if(amount >= 0 && amount < 6)
{
if(amount == 5 && PlayerInfo[playerid][AdminLevel] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to set a players Admin Level to Level 5.");
if(amount == 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to set a players Admin Level to Level 4.");
PlayerInfo[id][AdminLevel] = amount;
new pname[64];
GetPlayerName(id, pname,sizeof(pname));
new string[128];
new astring[128];
new aname[64];
GetPlayerName(playerid, aname,sizeof(aname));
new arank[14];
if(PlayerInfo[playerid][AdminLevel] == 4) format(arank,sizeof(arank), "Lead Admin");
if(PlayerInfo[playerid][AdminLevel] == 5) format(arank,sizeof(arank), "Server Owner");
new prank[14];
if(PlayerInfo[id][AdminLevel] == 1) format(prank,sizeof(prank), "Assistant");
if(PlayerInfo[id][AdminLevel] == 2) format(prank,sizeof(prank), "Moderator");
if(PlayerInfo[id][AdminLevel] == 3) format(prank,sizeof(prank), "Admin");
if(PlayerInfo[id][AdminLevel] == 4) format(prank,sizeof(prank), "Lead Admin");
if(PlayerInfo[id][AdminLevel] == 5) format(prank,sizeof(prank), "Server Owner");
format(string,sizeof(string), "set %s(%d)'s Admin Level to %s(%d).", pname, id, prank, amount);
SendAdminMessage(playerid, string);
format(astring,sizeof(astring),"** Congratulations! %s %s(%d) set your Admin Level to %s(%d)!", arank, aname, playerid, prank, amount);
SendClientMessage(playerid, COLOR_CYAN, astring);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /set admin (ID/Partial Name) (Admin Level ID)");
SendClientMessage(playerid, COLOR_GREY, "Normal Player(0), Assistant(1), Moderator(2), Admin(3), Lead Admin(4), Server Owner(5)");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Invalid Player ID/Name.");
}
}
if(!strcmp(item,"donator",true))
{
if(PlayerInfo[playerid][AdminLevel] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(IsPlayerConnected(id))
{
if(amount >= 0 && amount < 6)
{
PlayerInfo[id][DonatorLevel] = amount;
new pname[64];
GetPlayerName(id, pname,sizeof(pname));
new string[128];
new astring[128];
new aname[64];
GetPlayerName(playerid, aname,sizeof(aname));
new arank[14];
if(PlayerInfo[playerid][AdminLevel] == 4) format(arank,sizeof(arank), "Lead Admin");
if(PlayerInfo[playerid][AdminLevel] == 5) format(arank,sizeof(arank), "Server Owner");
format(string,sizeof(string), "set %s(%d)'s Donator Level to %d.", pname, id, amount);
SendAdminMessage(playerid, string);
format(astring,sizeof(astring),"** %s %s(%d) set your Donator Level to %d! Thank you for your contribution.", arank, aname, playerid, amount);
SendClientMessage(playerid, COLOR_DONATORGOLD, astring);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /set donator (ID/Partial Name) (Donator Level 0-5)");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Invalid Player ID/Name.");
}
}
if(!strcmp(item,"skin",true))
{
if(PlayerInfo[playerid][AdminLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Invalid Player ID/Name.");
if(amount < 0 || amount > 299 || amount == 42 || amount == 53 || amount == 65 || amount == 74 || amount == 86 || amount == 91 || amount == 119 || amount == 149 || amount == 208 || amount == 273) return SendClientMessage(playerid, COLOR_GREY, "Invalid Skin ID. [0-299] - Note: Some doesn't work.");
SetPlayerSkin(id, amount);
new aname[64];
GetPlayerName(playerid, aname,sizeof(aname));
new pstring[128];
new arank[16];
if(PlayerInfo[playerid][AdminLevel] == 3) format(arank,sizeof(arank), "Admin");
if(PlayerInfo[playerid][AdminLevel] == 4) format(arank,sizeof(arank), "Lead Admin");
if(PlayerInfo[playerid][AdminLevel] == 5) format(arank,sizeof(arank), "Server Owner");
format(pstring,sizeof(pstring),"** %s %s(%d) has changed your skin to Skin ID %d", arank, aname, playerid, amount);
SendClientMessage(id, COLOR_CYAN, pstring);
new astring[128];
new pname[64];
GetPlayerName(id, pname,sizeof(pname));
format(astring,sizeof(astring), "has changed the skin of %s(%d) to ID %d.", pname, id, amount);
SendAdminMessage(playerid, astring);
}
if(!strcmp(item,"health",true))
{
if(PlayerInfo[playerid][AdminLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Invalid Player ID/Name.");
if(amount < 0 || amount > 100) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /set health (ID/Partial Name) (1-100)");
SetPlayerHealth(id, amount);
new aname[64];
GetPlayerName(playerid, aname,sizeof(aname));
new pstring[128];
new arank[16];
if(PlayerInfo[playerid][AdminLevel] == 3) format(arank,sizeof(arank), "Admin");
if(PlayerInfo[playerid][AdminLevel] == 4) format(arank,sizeof(arank), "Lead Admin");
if(PlayerInfo[playerid][AdminLevel] == 5) format(arank,sizeof(arank), "Server Owner");
format(pstring,sizeof(pstring),"** %s %s(%d) has set your health to %d", arank, aname, playerid, amount);
SendClientMessage(id, COLOR_CYAN, pstring);
new astring[128];
new pname[64];
GetPlayerName(id, pname,sizeof(pname));
format(astring,sizeof(astring), "has set the health of %s(%d) to %d.", pname, id, amount);
SendAdminMessage(playerid, astring);
}
if(!strcmp(item,"armor",true))
{
if(PlayerInfo[playerid][AdminLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Invalid Player ID/Name.");
if(amount < 0 || amount > 100) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /set armor (ID/Partial Name) (1-100)");
SetPlayerArmour(id, amount);
new aname[64];
GetPlayerName(playerid, aname,sizeof(aname));
new pstring[128];
new arank[16];
if(PlayerInfo[playerid][AdminLevel] == 3) format(arank,sizeof(arank), "Admin");
if(PlayerInfo[playerid][AdminLevel] == 4) format(arank,sizeof(arank), "Lead Admin");
if(PlayerInfo[playerid][AdminLevel] == 5) format(arank,sizeof(arank), "Server Owner");
format(pstring,sizeof(pstring),"** %s %s(%d) has set your armor to %d", arank, aname, playerid, amount);
SendClientMessage(id, COLOR_CYAN, pstring);
new astring[128];
new pname[64];
GetPlayerName(id, pname,sizeof(pname));
format(astring,sizeof(astring), "has set the armor of %s(%d) to %d.", pname, id, amount);
SendAdminMessage(playerid, astring);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "XUSAGE: /set (/help sets) (ID/Partial Name) (Amount/Level/Faction)");
}
return 1;
}
your using if(!strcmp(item,"skin",true)) i thin when you have the ! in it means if it isn't
|
muahahahaha thanks for the code
![]() nah joking but calling meh that nah i wont help xD |
well calling others faggots wont help and if you dont want to steal your code dont put the hole command
put like 3 lines and in the middle the error line, USE your brain xD This forum requires that you wait 120 seconds between posts. Please try again in 21 seconds. freaking boxhead forum! |
This forum requires that you wait 120 seconds between posts. Please try again in 21 seconds.
freaking boxhead forum! |
new aitem; // cell, but you're trying to put a string in it!
new id;
new amount;
if(PlayerInfo[playerid][AdminLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params,"sud",aitem,id,amount)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /set (/help sets) (ID/Partial Name) (Amount/Level/Faction)"); // your sscanf line is putting a string in the cell.
new item[128];
format(item,sizeof(item),"%s",aitem); // now you're putting this cell in a string array, your data is lost.
new item[128]; // create a string array
new id;
new amount;
if(PlayerInfo[playerid][AdminLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params,"sud",item,id,amount)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /set (/help sets) (ID/Partial Name) (Amount/Level/Faction)"); // put the first parameter directly into the string.
He is using sscanf. Your first problem is here:
pawn Код:
pawn Код:
|