Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/fill", true) == 0)
- {
- new string[32];
- tmp = strtok(cmdtext, idx);
- if(strlen(tmp) == 0)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /fill [litrii]");
- format(string, sizeof(string), "Poti alimenta %d litrii", GasMax - Gas[VID]);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- return 1;
- }
- new litrii = strval(tmp);
- if(litrii > GasMax - Gas[VID])
- {
- format(string, sizeof(string), "Poti alimenta %d litrii", GasMax - Gas[VID]);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- return 1;
- }
- if(IsPlayerConnected(playerid))
- {
- if(IsAtGasStation(playerid))
- {
- TogglePlayerControllable(playerid, 0);
- GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Asteapta, se incarca",2000,3);
- SetTimerEx("Fillup", RefuelWait, false, "i", litrii);
- Refueling[playerid] = 1;
- }
- else
- {
- SendClientMessage(playerid,COLOR_GREY,"{30a030}[saveG]: {ffffff}Ne pare rau, dar nu te afli intr-o Statie de Gas.");
- }
- }
- return 1;
- }
- public Fillup(litrii)
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- new VID;
- new cost;
- new string[256];
- VID = GetPlayerVehicleID(i);
- if(Refueling[i] == 1)
- {
- cost = litrii * SBizzInfo[3][sbEntranceCost];
- if(GetPlayerMoney(i) >= cost)
- {
- Gas[VID] += litrii;
- format(string,sizeof(string),"» Ai facut plinul la Vehicul: Pret: %d Lei.",cost);
- SendClientMessage(i,COLOR_LIGHTBLUE,string);
- GivePlayerMoney(i, - cost);
- SBizzInfo[3][sbTill] += cost;
- ExtortionSBiz(3, cost);
- Refueling[i] = 0;
- TogglePlayerControllable(i, 1);
- }
- else
- {
- format(string,sizeof(string),"» Ne pare rau, dar nu ai %d Lei pentru a alimenta Vehiculul.",cost);
- SendClientMessage(i,COLOR_LIGHTBLUE,string);
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement