05.06.2012, 06:49
Well, hello again. Made a trunk system, that should open the trunk when we are near an owned car with /trunkinfo but it just tells me i am not near any buyable vehicle.. :S
I am really near them.. Used more distance range thanf or /lock and /lock works...
I verified all, it's a simmple code, i don't really know why it fails...
Didn't even made the good look saying gun names and stuff, cos i wanted to make the basic first, but it says me the samething all the time..
Tried with returns, without returns..
I am really near them.. Used more distance range thanf or /lock and /lock works...
I verified all, it's a simmple code, i don't really know why it fails...
pawn Код:
CMD:trunkinfo(playerid, params[])
{
for(new i = 1; i < sizeof(CarInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, CarInfo[i][X], CarInfo[i][Y], CarInfo[i][Z]))
{
if(CarInfo[i][Lock] == 0)
{
GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,true,objective);
new string[128];
format(string, sizeof(string), "||--------------Trunk---------------||");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Weapon Slot 1: %d with %d ammo.", CarInfo[i][Weapon1], CarInfo[i][Weapon1Ammo]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Weapon Slot 2: %d with %d ammo.", CarInfo[i][Weapon2], CarInfo[i][Weapon2Ammo]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Weapon Slot 3: %d with %d ammo.", CarInfo[i][Weapon3], CarInfo[i][Weapon3Ammo]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Weapon Slot 4: %d with %d ammo.", CarInfo[i][Weapon4], CarInfo[i][Weapon4Ammo]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Weapon Slot 5: %d with %d ammo.", CarInfo[i][Weapon5], CarInfo[i][Weapon5Ammo]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Materials: %d ", CarInfo[i][Materials]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "||----------------------------------||");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "This vehicle is locked.");
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not near any vehicle.");
}
return 1;
}
Tried with returns, without returns..