Command Help
#1

Can anyone help me make two commands?

a
/goldrims - makes the car your in have goldrims perm until changed.
/refund - gives player 5m cash, 100k mats 500 pot and crack and silver vip.

im using
zcmd
Reply
#2

What are your player variables for VIP, Cash, Pot and materials?
Reply
#3

Can you provide the variables you use to store player's vehicle modifications, money, materials, pot, crack and VIP level?
Reply
#4

GivePlayerCash
PlayerInfo[giveplayerid][pDonateRank]
PlayerInfo[giveplayerid][pMats]
PlayerInfo[giveplayerid][pPot]
PlayerInfo[giveplayerid][pCrack]

i believe there correct.

edit; not sure about the vehicle thing.

edit again; can you do levels too?
Reply
#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
#6

iRage, how could i find the var?
Reply
#7

Does your script save vehicle modifications?
Reply
#8

yes i suppose.
Reply
#9

You should try modding your vehicle and respawning it somehow, by parking it or restarting the server or relogging if the vehicle disappears when its owner logs out or any other method.

Tell me if it respawns with its modifications or not.
Reply
#10

errors;
Код:
C:\Users\Nathan\Desktop\Evation RP\gamemodes\ERP.pwn(54877) : error 001: expected token: ",", but found ";"
C:\Users\Nathan\Desktop\Evation RP\gamemodes\ERP.pwn(54881) : error 001: expected token: ",", but found ";"
lines
Код:
	GetPlayerName(playerb, pname, sizeof(pname);
	GetPlayerName(playerid, pname, sizeof(pname);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)