06.07.2012, 17:00
Okay so, I dont get one thing. I made some jobs I am about to release and I tried multiple things to get this working but it's not gonna work at all. My thing is that when you reach checkpoint you get Dialog that will show you "Choose your reward", then you have to choose between weapons or money ((WORKS)). Now the problem is that I cannot script that it gives him random weapon. I have problem with this... Anyone can help? So basically I need when he choose "weapon" from the dialog he gets random weapon.
PHP Code:
if(SmugglerJob[playerid] == 3){
SmugglerJob[playerid] = 0;
SendClientMessage(playerid, COLOR_YELLOW, "*Crazy ED: Fine... Here you go! Come back soon when you get more crates! Now piss off!");
SendClientMessage(playerid, COLOR_YELLOW, "Gradulations. You have completed your Smuggling route. You have received 500$");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your reward", "Money\n.Deagle", "Accept", "Decline");
DisablePlayerCheckpoint(playerid);
return 1;
}
PHP Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1:
{
if(!response)
{
SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
return 1;
}
switch(listitem)
{
case 0:
{
GivePlayerMoney(playerid, 500);
}
case 1:
{
//RANDOM WEAPON
}
}
}
}
return 1;
}