17.02.2018, 11:37
Well, i know i have 3 arguments and then 1. That's what I ask: can be dangerous if I call a function with more parameters than the public?
Why? look:
Why? look:
PHP код:
SpawnCar(type, Float:x, Float:y, Float:z, Float:a, c1, c2, respawn=300, addsiren=0)
{
new id = CreateVehicle(type, x, y, z, a, c1, c2, respawn, addsiren);
if(id != INVALID_VEHICLE_ID)
CallLocalFunction("OnVehicleCreate", "iiffffiiii", q, type, x, y, z, a, c1, c2, respawn, addsiren);
return id;
}
// inside vehicle_data.inc
#include <YSI\y_hooks>
hook OnVehicleCreate(vehicleid)
{
Vehicle_Fuel[vehicleid] = 0;
Players_In_Vehicle[vehicleid] = 0;
// i don't need info about vehicle's spawn pos here, so there is just vehicleid as parameter.
}
// inside vehicle_mod_and_colors.inc
#include <YSI\y_hooks>
hook OnVehicleCreate(vehicleid, type, Float:x, Float:y, Float:z, Float:a, c1, c2)
{
Vehicle_Color_1[vehicleid] = c1;
Vehicle_Color_2[vehicleid] = c2;
// here I need details about colors.
}