Jump to content
  • 0

Question

Posted

Am aceasta comanda:

[pawn]// Refuel the player's vehicle

COMMAND:fuel(playerid, params[])

{

// Setup local variables

new vID;

// Send the command to all admins so they can see it

SendAdminText(playerid, "/fuel", params);

// Check if the player has logged in

if (APlayerData[playerid][LoggedIn] == true)

{

// Check if the player's admin-level is at least 1

if (APlayerData[playerid][PlayerLevel] >= 1)

{

// Check if the player is inside a vehicle

if (IsPlayerInAnyVehicle(playerid))

{

    // Get the vehicleid

    vID = GetPlayerVehicleID(playerid);

    // Refuel the vehicle

    AVehicleData[vID][Fuel] = MaxFuel;

// Let the player know about it

SendClientMessage(playerid, 0x00FF00FF, "Your vehicle is refuelled");

}

else

SendClientMessage(playerid, 0x00FF00FF, "You're not driving a vehicle");

}

else

    return 0;

}

else

    return 0;

// Let the server know that this was a valid command

return 1;

}[/pawn]

si vreau sa o modific sa alimenteze toate masinile de pe server, cum procedez?

?q=192&s=s&bg1=5eeb06&bg2=3a7bfc&t=000&gl=fff&b=000000&gbg=000

1 answer to this question

Recommended Posts

Posted

[pawn]

COMMAND:fuel(playerid, params[ ])

{

// Setup local variables

new vID;

// Send the command to all admins so they can see it

SendAdminText(playerid, "/fuel", params);

// Check if the player has logged in

if (APlayerData[playerid][LoggedIn] == true)

{

// Check if the player's admin-level is at least 1

if (APlayerData[playerid][PlayerLevel] >= 1)

{

// Check if the player is inside a vehicle

if (IsPlayerInAnyVehicle(playerid))

{

    for( new i = 0; i < MAX_VEHICLES; I++ )

    {

    // Get the vehicleid

    //vID = GetPlayerVehicleID(playerid);

    // Refuel the vehicle

    AVehicleData[Fuel] = MaxFuel;

// Let the player know about it

SendClientMessage(playerid, 0x00FF00FF, "Your vehicle is refuelled");

}

}

else

SendClientMessage(playerid, 0x00FF00FF, "You're not driving a vehicle");

}

else

    return 0;

}

else

    return 0;

// Let the server know that this was a valid command

return 1;

}[/pawn]

Just Rock

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.