29.03.2013, 14:59
Hey
how can i make a Give XP Command only for lvl 4 admin? (Owner)
how can i make a Give XP Command only for lvl 4 admin? (Owner)
COMMAND:money(playerid,params[])
{
if(Admin[playerid] < 4) return NoSuccess(playerid,"You cannot use this Command!");
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
GivePlayerMoney(i,500);
}
}
SendClientMessageToAll(neongruen,"An Admin gave all Players $500!");
return 1;
}
enum ePlayerInfo
{
// ....
XP,
// ...
};
new PlayerInfo[MAX_PLAYERS][ePlayerInfo]
// Usage
PlayerInfo[playerid][XP] = value;
#include "zcmd"
#include "sscanf2"
COMMAND:xp(playerid, params[])
{
if(PlayerAcc[playerid][AdminLevel] >= 4) // change this to your admin system.
{
new target;
new amount;
if(sscanf(params, "ud", target, amount)
{
new str[128];
format(str, sizeof(str), "Your XP is now %d .", amount);
SendClientMessage(playerid, 0xFFFFFFF, str);
PlayerAcc[playerid][xp] == amount; //change to your system.
}
else SendClientMessage(playerid, -1, "USAGE: /xp [Player ID] [Amount]");
}
else SendClientMessage(playerid, -1, "Urm... This command is not scripted yet. Use /help to see new commands.");
return 1;
}