Help me please, thanks.
#1

Код:
new string[128];
	new houseid = getClosestPizzaDelivery(playerid);
	new deliverytime = getMaxPizzaDeliveryTime(playerid, houseid);
	SetPlayerCheckpoint(playerid, Houses[houseid][EHouseX],Houses[houseid][EHouseY],Houses[houseid][EHouseZ],5.0);
	SetPVarInt(playerid, "IsOnPizzaRoute", 1);
	SetPVarFloat(playerid, "PizzaDeliveryTime", deliverytime);
	format(string, sizeof(string), "You have %d seconds to deliver the pizza to the destination.", deliverytime);
	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	return 1;
}
Hii right now when you sit on pizza bike and start job.. it shows youthe checkpoint to the house.. but ig you enter e.g /gps and set another checkpoint and deliver there it will give you money, I want to restrict it to orignal locations.. please help, thank you very much.
Reply
#2

You have to store the coords of the mission in a variable, and at OnPlayerEnterCheckpoint you check if his current position matches the position of his mission. Or you disable the gps while in a mission

-TG
Reply
#3

Quote:
Originally Posted by thegamer355
Посмотреть сообщение
You have to store the coords of the mission in a variable, and at OnPlayerEnterCheckpoint you check if his current position matches the position of his mission. Or you disable the gps while in a mission

-TG
Hey, I think diabling /gps and /jobspots command would be alright.. can you do it for me if you don't mind? thanks
Reply
#4

Hey,

I am using the next variable:
pawn Код:
new InMission[MAX_PLAYERS] = 0;
Then at onplayerconnect i set the value for the playerid to 0, just in case
This is done using the following line:
pawn Код:
InMission[playerid] = 0;
When the player starts the mission set the value to something else (i use value 1 and 2 to indicate the state of the mission, head to loading / head to unloading). For example:
pawn Код:
InMission[playerid] = 1;
In the commands you can add the following line:
pawn Код:
if(InMission[playerid] != 0) return SendClientMessage(playerid, -1, "*You are currently in a mission. Therefore you cannot use this function!");
-TG
Reply
#5

Quote:
Originally Posted by thegamer355
Посмотреть сообщение
Hey,

I am using the next variable:
pawn Код:
new InMission[MAX_PLAYERS] = 0;
Then at onplayerconnect i set the value for the playerid to 0, just in case
This is done using the following line:
pawn Код:
InMission[playerid] = 0;
When the player starts the mission set the value to something else (i use value 1 and 2 to indicate the state of the mission, head to loading / head to unloading). For example:
pawn Код:
InMission[playerid] = 1;
In the commands you can add the following line:
pawn Код:
if(InMission[playerid] != 0) return SendClientMessage(playerid, -1, "*You are currently in a mission. Therefore you cannot use this function!");
-TG
Thanks, +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)