Command Help
#5

I suppose you're using sscanf2 too, so here we go.


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;
}
As for the vehicle, until you get the variable that saves modifications, use this:

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;
}
Reply


Messages In This Thread
Command Help - by Evation - 14.05.2012, 09:37
Re: Command Help - by iGetty - 14.05.2012, 09:39
Re: Command Help - by iRage - 14.05.2012, 09:44
Re: Command Help - by Evation - 14.05.2012, 09:45
Re: Command Help - by iRage - 14.05.2012, 09:53
Re: Command Help - by Evation - 14.05.2012, 09:56
Re: Command Help - by iRage - 14.05.2012, 09:58
Re: Command Help - by Evation - 14.05.2012, 10:01
Re: Command Help - by iRage - 14.05.2012, 10:02
Re: Command Help - by Evation - 14.05.2012, 10:03

Forum Jump:


Users browsing this thread: 1 Guest(s)