once a player has a mission they can't get a new one. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: once a player has a mission they can't get a new one. (
/showthread.php?tid=178244)
once a player has a mission they can't get a new one. -
Haydz - 21.09.2010
i'v got no idea how to do this but once a player has a mission from /work i want it so that they can't start another mission.
i want it to send a message says "You're already delivering passengers"
heres my script:
http://pastebin.com/gdRLqZpp
i had no idea what to search on the wiki so your help would be much appreciated.
Re: once a player has a mission they can't get a new one. -
Danny - 21.09.2010
use SetPVarInt(playerid,"Inmission,1); at your random function.
Before the random part, add:
Quote:
if(GetPVarInt(playerid,"Inmission") == 1) {
SendClientMessage(playerid, YOUR_COLOR,"You're already delivering passengers!"); return 1;
}
|
Replace YOUR_COLOR by your own color.
Re: once a player has a mission they can't get a new one. -
Haydz - 21.09.2010
Quote:
Originally Posted by -Danny-
use SetPVarInt(playerid,"Inmission,1); at your random function.
Before the random part, add:
Replace YOUR_COLOR by your own color.
|
:/ what do you mean by "at" it, if possible could you just add it in, thanks.
Re: once a player has a mission they can't get a new one. -
Danny - 21.09.2010
Код:
if (!strcmp("/work", cmdtext, true))
40. {
if(GetPVarInt(playerid,"Inmission") == 1) {
SendClientMessage(playerid, YOUR_COLOR,"You're already delivering passengers!"); return 1;
}
41. new rand = random(3);
42. switch(rand)
43. {
44. case 0:
45. {
46. SendClientMessage(playerid, 0xFFFF00AA,"You are delivering Waste from Los Santos Airport to Landfill");
47. SetPlayerCheckpoint(playerid, -694.9723, -1906.2748, 11.6886, 10.0);
SetPVarInt(playerid,"Inmission",1);
48. }
49. case 1:
50. {
51. SendClientMessage(playerid, 0xFFFF00AA,"You are delivering Skateboards from Los Santos Airport to Haydens House");
52. SetPlayerCheckpoint(playerid, -899.8469, -1947.8582, 80.2679, 10.0);
SetPVarInt(playerid,"Inmission",1);
53. }
54. case 2:
55. {
56. SendClientMessage(playerid, 0xFFFF00AA,"You are delivering Airport Parts from Los Santos Airport to Los Santos Plane Garage");
57. SetPlayerCheckpoint(playerid, 1379.6129, -2416.9490, 14.4758, 10.0);
SetPVarInt(playerid,"Inmission",1);
58. }
59. }
60. return 1;
61. }
62. return 0;
63.}
The line numbers are caused by Pastebin, delete them and it should work.
Re: once a player has a mission they can't get a new one. -
Haydz - 21.09.2010
The script causes pawno to crash.
Re: once a player has a mission they can't get a new one. -
Haydz - 21.09.2010
nvm just made a stupid mistake.