Pizza job
#1

I want to make a pizza delivery job, but my problem is that nothing happens when I get in the car.

Here's the code:

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(vehicleid == 448)
	{
	if(PlayerInfo[playerid][pJob] == 1)
	{
	SendClientMessage(playerid, COLOR_YELLOW, "--------PIZZA DELIVERY--------");
 	SendClientMessage(playerid, COLOR_ORANGE, "Your job is to deliver these pizzas");
	SendClientMessage(playerid, COLOR_ORANGE, "Your current destination is marked.");
 	SendClientMessage(playerid, COLOR_YELLOW, "--------PIZZA DELIVERY--------");
 	new rand = random(sizeof(PizzaPoint));
	SetPlayerCheckpoint(playerid, PizzaPoint[rand][0],PizzaPoint[rand][1],PizzaPoint[rand][2] , 3.0);
	}
	else
	{
	RemovePlayerFromVehicle(playerid);
	SendClientMessage(playerid, COLOR_RED, "You do not work for pizza delivery!");
	}
	}
	return 1;
}
Reply
#2

PHP код:
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
I wouldn't hard-code your mission to a vehicleid like that - if you ever want to add or remove any vehicles it makes maintenance almost impossible. Either save the vehicleid in a variable or use the modelid instead.
I actually made a vehicleid variable, but still nothing happens when I sit in it.
Reply
#4

Try this.
Код:
GetVehicleModel(vehicleid) == 448
Reply
#5

Quote:
Originally Posted by Rillsen1998
Посмотреть сообщение
Try this.
Код:
GetVehicleModel(GetVehicleID(vehicleid) == 448)
error 017: undefined symbol "GetVehicleID"
Reply
#6

My bad, try this.
Код:
GetVehicleModel(vehicleid) == 448
Reply
#7

Quote:
Originally Posted by Rillsen1998
Посмотреть сообщение
My bad, try this.
Код:
GetVehicleModel(vehicleid) == 448
HOLY MOTHER CHICKEN OF CLUCKIN' BELL THANK YOU! It works +Rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)