once a player has a mission they can't get a new one.
#1

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.
Reply
#2

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.
Reply
#3

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.
Reply
#4

Код:
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.
Reply
#5

The script causes pawno to crash.
Reply
#6

nvm just made a stupid mistake.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)