vehicle health
#1

Код:
C:\Users\Imdaking\Desktop\New Folder (6)\Roleplay.pwn(5446) : error 017: undefined symbol "VehicleHealth"
C:\Users\Imdaking\Desktop\New Folder (6)\Roleplay.pwn(5446) : warning 215: expression has no effect
C:\Users\Imdaking\Desktop\New Folder (6)\Roleplay.pwn(5446) : error 001: expected token: ";", but found "]"
C:\Users\Imdaking\Desktop\New Folder (6)\Roleplay.pwn(5446) : error 029: invalid expression, assumed zero
C:\Users\Imdaking\Desktop\New Folder (6)\Roleplay.pwn(5446) : fatal error 107: too many error messages on one line
Код:
else if(!strcmp(params, "park", true, 4))
 	{
 		if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not inside any vehicle.");
		new vehicleid = GetPlayerVehicleID(playerid);
		new id = GetVehicleID(vehicleid);
		if(GetPlayerVehicleAccess(playerid, id) < 1)
		return SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have the keys for this vehicle.");

  		new Float:x, Float:y, Float:z;
		GetPlayerPos(playerid, x, y, z);

		GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
		SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0);

		VehicleHealth[id] = GetVehicleHealth(id, health);
		GetVehiclePos(VehicleID[id], VehiclePos[id][0], VehiclePos[id][1], VehiclePos[id][2]);
		GetVehicleZAngle(VehicleID[id], VehiclePos[id][3]);
		VehicleInterior[id] = GetPlayerInterior(playerid);
		VehicleWorld[id] = 100;
		SaveVehicle(id);
error line : VehicleHealth[id] = GetVehicleHealth(id, health);
Reply
#2

PHP код:
else if(!strcmp(params"park"true4))
     {
         if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playeridCOLOR_LIGHTRED"You are not inside any vehicle.");
        new 
vehicleid GetPlayerVehicleID(playerid);
        new 
id GetVehicleID(vehicleid);
        if(
GetPlayerVehicleAccess(playeridid) < 1)
        return 
SendClientMessage(playeridCOLOR_LIGHTRED"You don't have the keys for this vehicle.");
          new 
Float:xFloat:yFloat:z,Float:carhealth;
        
GetPlayerPos(playeridxyz);
        
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
        
SetVehicleParamsEx(vehicleid0000000);
        
GetVehicleHealth(idcarhealth);
        
VehicleHealth[id] = carhealth;
        
GetVehiclePos(VehicleID[id], VehiclePos[id][0], VehiclePos[id][1], VehiclePos[id][2]);
        
GetVehicleZAngle(VehicleID[id], VehiclePos[id][3]);
        
VehicleInterior[id] = GetPlayerInterior(playerid);
        
VehicleWorld[id] = 100;
        
SaveVehicle(id); 
Try
Reply
#3

Same errors.
Reply
#4

Quote:

new VehicleHealth[MAX_VEHICLES];

in top of you'r script
Reply
#5

VehicleHealth[id] = GetVehicleHealth(id, health);
^^^ this line is wrong in probably one/bot of these issues:
A) GetVehicleHealth doesn't return the health, it works like GetPlayerName
B) Declare VehicleHealth as float if you didn't already
C) You should send the function the actual vehicle ID, not the array ID of it (doubt they are same in your code, they are same in mine tho.)

Right way to use:
Quote:

GetVehicleHealth(vehicleid, VehicleHealth[id]);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)