04.09.2011, 20:46
hi, i wanna make a random trucking/taxi mission when a player enters a CP
to do that I made this code:
ok so as you can see I used if(mrand == 2 or 1)
but when I pickup the pickup nothing happens, I don't get the messages from the first random option, and nor do I get any message from the second random thing :/
please help me
thanks in advance
to do that I made this code:
pawn Код:
if(IsPlayerInDynamicCP(playerid, STW))
{
if(IsWorking[playerid] != 0)
{
SendClientMessage(playerid, COLOR_RED, "You already have a job! finish it or type /kill");
return 1;
}
if(vehicle != 516)
{
SendClientMessage(playerid, COLOR_RED, "You are not in the right vehicle for this mission!");
return 1;
}
if(gTeam[playerid] == TEAM_DRIVERS)
{
IsWorking[playerid] = 1;
TogglePlayerDynamicCP(playerid, STW, false); // This makes sure that there will be a new checkpoint
//hier zullen dan de random moeten komen
new mrand = random(2);
if(mrand == 1)
{
TogglePlayerDynamicCP(playerid, TRAVJ1, true); // Creates a new checkpoint at a different position
SetPlayerMapIcon( playerid, 2, 334.4390,-1519.8026,35.7015, 41, 0, MAPICON_GLOBAL );
GameTextForPlayer(playerid,"~w~ Job Lvl 1~g~ :Travis Pastrana is going to participate the X-games",4000,3);
SendClientMessage(playerid, COLOR_YELLOW, "|- Check the map to see the point where to go. -|");
//De Textdraw
TextDrawShowForPlayer(playerid,Opdracht);
}
else if(mrand == 2)
{
SendClientMessage(playerid, COLOR_YELLOW, "|- This is just a test -|");
}
return 1;
}
}
but when I pickup the pickup nothing happens, I don't get the messages from the first random option, and nor do I get any message from the second random thing :/
please help me
thanks in advance