14.05.2012, 09:53
I suppose you're using sscanf2 too, so here we go.
Command: /refund
Note: Replace /* level */ with the VIP level of silver.
As for the vehicle, until you get the variable that saves modifications, use this:
Command: /refund
Note: Replace /* level */ with the VIP level of silver.
pawn Код:
CMD:refund(playerid, params[])
{
new playerb, string[128], pname[MAX_PLAYER_NAME];
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /refund [playerid]");
if(!IsPlayerConnected(playerb) || playerb == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: Invalid player id.");
// Giving the refund
GivePlayerCash(playerb, 5000000);
PlayerInfo[playerb][pDonateRank] = /* level */;
PlayerInfo[playerb][pMats] = 100000;
PlayerInfo[playerb][pPot] = 500;
PlayerInfo[playerb][pCrack] = 500;
// Getting name of the player you refunded and sending you a confirmation message
GetPlayerName(playerb, pname, sizeof(pname);
format(string, sizeof(string), "You have refunded %s.", pname);
SendClientMessage(playerid, 0xFFFFFFFF, string);
// Getting your name and sending the player you refunded a confirmation message
GetPlayerName(playerid, pname, sizeof(pname);
format(string, sizeof(string), "%s has refunded you.", pname);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
pawn Код:
CMD:goldrims(playerid, params[])
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not driving a vehicle.");
AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
SendClientMessage(playerid, 0xFFFFFFFF, "You have added Gold Rims to your vehicle.");
return 1;
}