dcmd_setdonator(playerid, params[])
{
new donatorlvl, target, myString[128], adminName[MAX_PLAYER_NAME], targetName[MAX_PLAYER_NAME];
if(pInfo[playerid][pAdmin] < 5) return SystemMessage(playerid, "You are not an Administrator with the required level.");
if(sscanf(params,"ud"),target,donatorlvl) SystemMessage(playerid, "USAGE: /setdonator [playername/playerid] [level (1-3)]");
if(target == INVALID_PLAYER_ID) return SystemMessage(playerid, "That player is not active.");
if(donatorlvl > 3 && donatorlvl < 0) return SystemMessage(playerid, "Please enter a valid donator level. (1-3)");
GetPlayerName(playerid, adminName, sizeof(adminName));
format(myString, sizeof(myString), "Administrator %s has set your donator level to %i.",adminName, donatorlvl);
SystemMsg(target, myString),
GetPlayerName(target, targetName, sizeof(targetName));
format(myString, sizeof(myString), "You have set %s's donator level to %i.",targetName, donatorlvl);
pInfo[playerid][pDonator] = donatorlvl;
dUserSetINT(targetName).("Donator",pInfo[playerid][pDonator]);
return 1;
}
dcmd_setdonator(playerid, params[])
{
new donatorlvl, target, myString[128], adminName[MAX_PLAYER_NAME], targetName[MAX_PLAYER_NAME];
if(pInfo[playerid][pAdmin] < 5) return SystemMessage(playerid, "You are not an Administrator with the required level.");
if(target == INVALID_PLAYER_ID) return SystemMessage(playerid, "That player is not active.");
if(donatorlvl > 3 && donatorlvl < 0) return SystemMessage(playerid, "Please enter a valid donator level. (1-3)");
if(sscanf(params,"ud"),target,donatorlvl) return SystemMessage(playerid, "USAGE: /setdonator [playername/playerid] [level (1-3)]");
else
{
GetPlayerName(playerid, adminName, sizeof(adminName));
format(myString, sizeof(myString), "Administrator %s has set your donator level to %i.",adminName, donatorlvl);
SystemMsg(target, myString),
GetPlayerName(target, targetName, sizeof(targetName));
format(myString, sizeof(myString), "You have set %s's donator level to %i.",targetName, donatorlvl);
pInfo[playerid][pDonator] = donatorlvl;
dUserSetINT(targetName).("Donator",pInfo[playerid][pDonator]);
}
return 1;
}
Originally Posted by _❼_
pawn Код:
|
dcmd_setdonator(playerid, params[])
{
new donatorlvl, target, myString[128], adminName[MAX_PLAYER_NAME], targetName[MAX_PLAYER_NAME];
if(pInfo[playerid][pAdmin] < 5) return SystemMessage(playerid, "You are not an Administrator with the required level.");
else if(sscanf(params,"ud"),target,donatorlvl) SystemMessage(playerid, "USAGE: /setdonator [playername/playerid] [level (1-3)]");
else if(target == INVALID_PLAYER_ID) return SystemMessage(playerid, "That player is not active.");
else if(donatorlvl > 3 && donatorlvl < 0) return SystemMessage(playerid, "Please enter a valid donator level. (1-3)");
else
{
GetPlayerName(playerid, adminName, sizeof(adminName));
format(myString, sizeof(myString), "Administrator %s has set your donator level to %i.",adminName, donatorlvl);
SystemMsg(target, myString),
GetPlayerName(target, targetName, sizeof(targetName));
format(myString, sizeof(myString), "You have set %s's donator level to %i.",targetName, donatorlvl);
pInfo[playerid][pDonator] = donatorlvl;
dUserSetINT(targetName).("Donator",pInfo[playerid][pDonator]);
return 1;
}
}
dcmd_setdonator(playerid, params[])
{
new donatorlvl, target, myString[128], adminName[MAX_PLAYER_NAME], targetName[MAX_PLAYER_NAME];
if(pInfo[playerid][pAdmin] < 5) return SystemMessage(playerid, "You are not an Administrator with the required level.");
if(target == INVALID_PLAYER_ID) return SystemMessage(playerid, "That player is not active.");
if(donatorlvl > 3 && donatorlvl < 0) return SystemMessage(playerid, "Please enter a valid donator level. (1-3)");
if(sscanf(params,"ud",target,donatorlvl)) return SystemMessage(playerid, "USAGE: /setdonator [playername/playerid] [level (1-3)]");
else
{
GetPlayerName(playerid, adminName, sizeof(adminName));
format(myString, sizeof(myString), "Administrator %s has set your donator level to %i.",adminName, donatorlvl);
SystemMsg(target, myString),
GetPlayerName(target, targetName, sizeof(targetName));
format(myString, sizeof(myString), "You have set %s's donator level to %i.",targetName, donatorlvl);
pInfo[playerid][pDonator] = donatorlvl;
dUserSetINT(targetName).("Donator",pInfo[playerid][pDonator]);
}
return 1;
}