There are some problem in my new vehicle system
#1

I find a new way to add more vehicle in LARP
set all of the vehicles become ownable.and than

when the owner is FBI,COP,GANG_one..they can be driven by members.(it look so stupid?)

But there still some problem:

like this

Код:
public IsASalesVehicle(vehicleid)
{
	if(strcmp(CarInfo[vehicleid][cOwner], "SALE", true) == 0) { return 1; }
	return 0;
}

public IsACopCar(carid)
{
    if(strcmp(CarInfo[carid][cOwner], "LSPD", true) == 0)
    {
        return 1;
    }
    return 0;
}

public IsAnOwnableCar(vehicleid)
{
	if(vehicleid >= 184 && vehicleid <= MAX_VEHICLES) { return 1; }
	return 0;
}
If you wanna add more vehicle,just re-edit "vehicle.cfg"

But when i join my sever.I found that vehicles of the whole sever are sales vehicles..what the hell

Every vehicles are on sale

Код:
		if(IsASalesVehicle(newcar))
		{
			SendClientMessage(playerid, COLOR_GREY, "Sales vehicle,if you wanna buy, get to the Co-pilot seat and type/v buy");
			SafeRemovePlayerFromVehicle(playerid);
			GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~w~Welcome, type ~b~/v buy ~w~to buy this car, or ~b~/exit~w~ if you don't wanna buy it!",10000,4);
		}
		else if (IsAnAmbulance(newcar))
		{
		    if(PlayerInfo[playerid][pMember]== 4 && JobDuty[playerid] == 1 || PlayerInfo[playerid][pLeader]== 4 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { }
		    else
			{
				SafeRemovePlayerFromVehicle(playerid);
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "** You must be a medical");
			}
		}
  		else if (IsACopCar(newcar))
		{
		    if(IsAFreecop(playerid) && PlayerInfo[playerid][pDuty] == 1 || PlayerInfo[playerid][pMember]== 1 && PlayerInfo[playerid][pDuty] == 1 || PlayerInfo[playerid][pLeader]== 1 ||PlayerInfo[playerid][pMember]== 2|| PlayerInfo[playerid][pLeader]== 2 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { }
		    else
			{
				SafeRemovePlayerFromVehicle(playerid);
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "** You must be a cop");
			}
		}
Someone can tell me what's wrong?and how to deal with it.

Sorry for my bad English
Reply
#2

What error you get?
Reply
#3

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
What error you get?
No..it compiled success.But some BUG in sever.

All vehicle become sale vehicle
Reply
#4

please see "public IsASalesVehicle"
Reply
#5

Quote:
Originally Posted by nemanjatesic
Посмотреть сообщение
please see "public IsASalesVehicle"
sorry..i cannot find any mistake..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)