Steal Fuel?
#1

Ok i need a code for stealing fuel..

Im thinking a IsPlayerInArea and OnPlayerCommandText not sure how to save the fuel of hold it etc and a Timer im guessing to refill it<Can anyone tell me what i need

Exactly wat i need: Anyone can go upto a Tank and type /stealfuel,each tank has random ammounts,After 2 IRL mins it refills.

Thanks in advance.
Reply
#2

https://sampwiki.blast.hk/wiki/SetTimerEx
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/Random
Reply
#3

You want to steal the fuel from the gas station or a car?

If from te gas station just use IsPlayerInRangeOfPoint(playerid,5.0,x,y,z); x,y,z = coordinates of your gas station.

If from te car use this:

pawn Код:
cmd(stealfuel, playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        for(new i = 1; i < MAX_VEHICLES; i++)
        {
            if(GetDistanceFromPlayerToVehicle(playerid, i))
            {
                if(VariableInWhichYouStoreCarFuel[i] > 0)
                {
                    SetPVarInt(playerid,"StoledFuel",VariableInWhichYouStoreCarFuel[i]);
                    SendClientMessage(playerid,0xFFFFFFAA,"You stoled fuel!");
                }
                {
                    SendClientMessage(playerid,0xFFFFFFAA,"This vehicle hasn't got any fuel left!");
                }
                break;
            }
        }
    }
    return 1;
}
You will need zcmd to use that command, i forgot how to do it with OnPlayerCommandText and strval...

pawn Код:
stock GetDistanceFromPlayerToVehicle(playerid, vehicleid)
{
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    new Float:tmpdis;
    GetPlayerPos(playerid,x1,y1,z1);
    GetVehiclePos(vehicleid,x2,y2,z2);
    tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
    return floatround(tmpdis);
}
Reply
#4

Quote:
Originally Posted by Whizion
Посмотреть сообщение
You want to steal the fuel from the gas station or a car?
A Object Or Even A Area And I Can Just Place The Object There..

EDIT:
Quote:
Originally Posted by Whizion
Посмотреть сообщение
You will need zcmd to use that command, i forgot how to do it with OnPlayerCommandText and strval...
Dude thats exactly how i script...IDK DCMD & ZCMD and dat s**t :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)