25.10.2010, 09:52
Ok i need /stealfuel to be able to steal a random ammount of fuel and save it,Then thay can spend fuel to buy things etc.
i have checkpoints and /stealfuel has a timer i just need the fuel ammounts/saving done IDK how to start with it
heres the codes
I need these to be able to steal random ammouuts of fuel and save it,Also a /fuel to see your fuel,And must be able to trade/buy with fuel with other players.
The codes work fine with a timer between each steal
Please help i have no idea were to start :S
i have checkpoints and /stealfuel has a timer i just need the fuel ammounts/saving done IDK how to start with it
heres the codes
Код:
#define STEAL_FUEL 0 forward steal(playerid); new bool:stealfuel[MAX_PLAYERS]; new bool:canstealfuel[MAX_PLAYERS]; new bool:waitstealfuel[MAX_PLAYERS]; public OnGameModeInit() { CreateCheckpoint(GLOBAL_OWNER_ID, STEAL_FUEL, 1940.3191,1017.8076,992.4688, 2.4); StartCheckpointSeeking(); return 1; } public OnPlayerConnect(playerid) { canstealfuel[playerid] = false; return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext,"/stealfuel",true)) { if(waitstealfuel[playerid] == true) { SendClientMessage(playerid, RED, "[ATT]:Wait Before Stealing Fuel Again!"); } else if(canstealfuel[playerid] == true) { if(stealfuel[playerid] == false) { SetPlayerScore(playerid, GetPlayerScore(playerid)+1); GameTextForPlayer(playerid, "~w~Stealing Fuel ~r~Please Wait!",10000,5); SendClientMessage(playerid, RED, "[ATT]:You Are Stealing Fuel! Don't Exit The Checkpoint!"); timer1 = SetTimerEx("fuel", 10000, false, "d", playerid); stealfuel[playerid] = true; } else { SendClientMessage(playerid, RED, "[ATT]:You Are Already Stealing Fuel!"); } } else { SendClientMessage(playerid, RED, "[ATT]:You Need To Be In The Checkpoint To Steal Fuel!"); } return 1; } return 0; } public OnPlayerLeaveCheckpoint(playerid) { VerifyCheckpointe(playerid); return 1; } public OnPlayerEnterCheckpoint(playerid) { VerifyCheckpoint(playerid); return 1; } public OnCheckpointEXIT(playerid, checkpointid) { switch(checkpointid) { case STEAL_FUEL: { if(canstealfuel[playerid] == true) { canstealfuel[playerid] = false; if(stealfuel[playerid] == true) { stealfuel[playerid] = false; GameTextForPlayer(playerid, "~r~You Left The Checkpoint! No Fuel Stole'n!",4000,5); SendClientMessage(playerid, RED, "[ATT]:You Left The Checkpoint! No Fuel Stole'n!"); KillTimer(timer1); } } } } return 1; } public OnCheckpointEnter(playerid, checkpointid) { switch(checkpointid) { case STEAL_FUEL: { canstealfuel[playerid] = true; { GameTextForPlayer(playerid, "~r~/stealfuel",4000,5); SendClientMessage(playerid, RED, "[ATT]:Type /stealfuel To Start Stealing There Fuel!"); } } } return 1; }
The codes work fine with a timer between each steal
Please help i have no idea were to start :S