Help me please, thanks. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me please, thanks. (
/showthread.php?tid=639738)
Help me please, thanks. -
Puff - 22.08.2017
Код:
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.
Re: Help me please, thanks. -
thegamer355 - 22.08.2017
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
Re: Help me please, thanks. -
Puff - 22.08.2017
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
Re: Help me please, thanks. -
thegamer355 - 22.08.2017
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:
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:
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
Re: Help me please, thanks. -
Puff - 22.08.2017
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:
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:
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