Vehicleid
#10

Quote:
Originally Posted by JamesC
Посмотреть сообщение
pawn Код:
COMMAND:load(playerid,vehicleid, params[])
{
    new id = GetPlayerVehicleID(playerid);
    /*new
        Float:x,
        Float:y,
        Float:z;*/
// Uncomment if you need it.
    if(GetVehicleModel(id) == 476) // Removed previous conditional statement as there was no need for it.
    {
        // GetPlayerPos(playerid,x,y,z); // Uncomment if you need it.

        VehicleFire[id] = 0;
        AddVehicleMissiles(id,2.0,-1.05,0.0); // Since this checks if VehicleFire = 0, set the value of VehicleFire before you call it.
    }
    return 1;
}
There you go, I've commented what was wrong. Also, I have no idea why you get the player's position because you never use it.
Hmm..it still bugs. when someone unload/crash for first time after server start and the next one use /load, he needs to type it twice to get the rockets, and only when someone need to type it twice and then if someone press the fire button, he steals the rockets from other even if he never did type the cmd, it must be some other bug in the script that mess up with the vehicle ids or something.

If you want to make a check to find bad codes, heres the whole script
http://pastebin.com/7t5StZ55
Reply


Messages In This Thread
Vehicleid - by cruising - 14.01.2012, 07:13
Re: Vehicleid - by Spooky - 14.01.2012, 07:35
Re: Vehicleid - by cruising - 14.01.2012, 07:42
Re: Vehicleid - by JamesC - 14.01.2012, 07:45
Re: Vehicleid - by Steven82 - 14.01.2012, 07:48
Re: Vehicleid - by cruising - 14.01.2012, 08:01
Re: Vehicleid - by JamesC - 14.01.2012, 08:15
Re: Vehicleid - by cruising - 14.01.2012, 08:19
Re: Vehicleid - by JamesC - 14.01.2012, 08:27
Re: Vehicleid - by cruising - 14.01.2012, 08:43

Forum Jump:


Users browsing this thread: 1 Guest(s)