PlayerInfo[playerid][dRank] = 3;
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][dRank] = 3;
}
CMD:refundscore(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, "Syntax: /refundscore [playername/id]");
if(PlayerInfo[playerid][pScore] < 999)
{
PlayerInfo[playerid][pScore] = 1000;
format(string, sizeof(string), "You have set %s's score to one thousand!", GetPlayerName(giveplayerid);
SendClientMessage(playerid, -1, string);
}
else
{
format(string, sizeof(string), "%s has already been refunded!", GetPlayerName(giveplayerid);
SendClientMessage(playerid, -1, string);
}
}
else
{
SendClientMessage(playerid, -1, "You are not authorized to use this command!");
}
return 1;
}
CMD:refund(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /Refund < Amount >");
new amount = strval(params);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i) || GetPlayerScore(i) > 1000) continue;
SetPlayerScore(i, GetPlayerScore(i) + 1000); // Give players with less than 1000 score 1000 score
}
return 1;
}
pawn Код:
|