Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:setscore(playerid, params[])
- {
- if (! IsPlayerAdminEx(playerid) && pStats[playerid][userAdmin] < 3)
- {
- return SendClientMessage(playerid, COLOR_TOMATO, "You must be admin level 3+ to use this command.");
- }
- new targetid, amount;
- if (sscanf(params, "ui", targetid, amount))
- {
- return SendClientMessage(playerid, COLOR_THISTLE, "USAGE: /setscore [player] [amount]");
- }
- if (! IsPlayerConnected(targetid))
- {
- return SendClientMessage(playerid, COLOR_TOMATO, "The specified player is not conected.");
- }
- if (pStats[playerid][userAdmin] < pStats[targetid][userAdmin])
- {
- return SendClientMessage(playerid, COLOR_TOMATO, "You cannot use this command on higher level admin.");
- }
- SetPlayerScore(targetid, amount);
- PlayerPlaySound(targetid, 1057, 0.0, 0.0, 0.0);
- PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
- new buf[150];
- format(buf, sizeof(buf), "Admin %s(%i) has set your score to %i.", ReturnPlayerName(playerid), playerid, amount);
- SendClientMessage(targetid, COLOR_DODGER_BLUE, buf);
- format(buf, sizeof(buf), "You have set %s(%i)'s score to %i.", ReturnPlayerName(targetid), targetid, amount);
- SendClientMessage(playerid, COLOR_DODGER_BLUE, buf);
- SendDC(CHANNEL_ID, "Admin %s(%i) has set score to %s(%i) Amount: %i .", ReturnPlayerName(playerid), playerid, ReturnPlayerName(targetid), targetid, amount);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement