What is wrong in this?
#1

I am trying to make a command so that a Bulldozer can be placed on a Flatbed.. I do this,

if(arr_Wrecking[i] == vehicleid)
{
for(new i=0; i<sizeof(arr_Wrecking); i++)
{
arr_Wrecking[i] = INVALID_VEHICLE_ID;
playerveh[i] = INVALID_VEHICLE_ID;
KillTimer(TimerAtach[i]);
DestroyObject(GetPVarInt(i, "WreckingGate"));
DeletePVar(i, "WreckingGate");
return 1;
}

..But then I start getting errors about "SendClientMessageEx", and it all started happening when I added this line in,
for(new i=0; i<sizeof(arr_Wrecking); i++) .. Without that line though, I start getting errors, "undefined symbol "i" many times. I am a very nooby scripter so please help ..
Reply
#2

Well first you're getting undefined i because you're not defining the what the variable "i" is. You need to do this at the top of the command or whatever it is that you're using. This here also is a problem, since you said you didn't define "i" then how does the script know what the "i" variable is being assigned to:

if(arr_Wrecking[i] == vehicleid)
{

That needs to be replaced or fixed with whatever you're doing with that. I suggest you post the entire code of what you're trying to do so we have a better understanding of what you're trying to accomplish and where your errors are.
Reply
#3

I put that under public OnVehicleDeath(vehicleid)
Reply
#4

Here is the entire part..


public OnVehicleDeath(vehicleid)
{
if(Lamp[vehicleid] == 1)
{
DestroyObject(light[vehicleid]);
Lamp[vehicleid] = 0;
}
VehicleStatus{vehicleid} = 1;
arr_Engine{vehicleid} = 0;
estacionveh[vehicleid] = 0;
return 1;
{

if(arr_Wrecking[i] == vehicleid)
{
for(new i=0; i<sizeof(arr_Wrecking); i++)
{
arr_Wrecking[i] = INVALID_VEHICLE_ID;
playerveh[i] = INVALID_VEHICLE_ID;
KillTimer(TimerATACH[i]);
DestroyObject(GetPVarInt(i, "WreckingGate"));
DeletePVar(i, "WreckingGate");
return 1;
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)