10.03.2013, 14:08
You have to add: GivePlayerMoney(playerid, -100); (you can change the -100 to whatever)
PHP Code:
if(strcmp(cmd, "/refuel", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAtGasStation(playerid))
{
if(Gas[idcar] <= 99)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Re-Fueling Vehicle, please wait",2000,3);
SetTimer("Fillup",RefuelWait,0);
Refueling[playerid] = 1;
//Using GivePlayerMoney(); is to give someone money, but if you put a - in it, it will decrease the money
//GivePlayerMoney(playerid, 100); will give you 100$, GivePlayerMoney(playerid, -100); will take from you 100$
GivePlayerMoney(playerid, -100);
}
else
{
GameTextForPlayer(playerid,"~r~~n~~n~~n~~n~~n~~n~~n~~n~~n~Gas can is full",2000,3);
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"** You're not at a Gas Station!");
}
}
return 1;
}