Problem Get Player in personal vehicle
#5

You can write your hole code like this:

That makes it a lot easier.

Код:
stock CarOwner3(playerid, vehicleid)
{
	for(new i,idx; i<10; i++)
	{
		idx = PlayerInfo[playerid][pCarPers][i];
		if(idx != -1 && vehicleid == CarInfo[idx][cSpawn]) return 1;
	}
	return 0;
}


CMD:park(playerid, params[])
{
	if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not in your personal vehicle!");
	new getcarid = GetPlayerVehicleID(playerid);
	if(CarOwner3(playerid, getcarid)) // checking whether the player is in the personal car
	{
		PersonalCars(playerid, 2, getcarid); // In personal vehicle
	}
	else
	{
		SCM(playerid, -1, "[Personal Car's]: You are not in your personal vehicle!");
	}
	return 1;
}
Reply


Messages In This Thread
Problem Get Player in personal vehicle - by rollercaster - 26.11.2018, 16:01
Re: Problem Get Player in personal vehicle - by rollercaster - 27.11.2018, 07:02
Re: Problem Get Player in personal vehicle - by AmirSavand - 27.11.2018, 13:34
Re: Problem Get Player in personal vehicle - by rollercaster - 29.11.2018, 14:46
Re: Problem Get Player in personal vehicle - by Kaliber - 30.11.2018, 08:45
Re: Problem Get Player in personal vehicle - by rollercaster - 30.11.2018, 12:52

Forum Jump:


Users browsing this thread: 2 Guest(s)