12.02.2012, 16:57
hello guys after long time i have back on pawno scripting so i need to make the player to can just once to pick weapons so here what i done and what need to do to make that
Thanks
pawn Код:
CMD:vipguns(playerid, params[])
{
if(IsPlayerVip[playerid] >= 1)
{
ShowPlayerDialog(playerid, vipguns, DIALOG_STYLE_LIST, "Vip Guns", "Sawn-off Shotgun\nTec9\nM4\nAK-47\nSniper\nDesert Eagle\nParachute", "Accept", "Cancel");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You can not use this command. Reason: You are not VIP player.");
return 1;
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case vipguns:
{
if(!response)
{
SendClientMessage(playerid, COLOR_ORANGE, "You cancelled.");
return 1;
}
switch(listitem)
{
case 0:
{
//Sawn-off Shotgun
GivePlayerWeapon(playerid, 26, 500);
}
case 1:
{
//tec9
GivePlayerWeapon(playerid, 32, 500);
}
case 2:
{
//M4
GivePlayerWeapon(playerid, 31, 500);
}
case 3:
{
//AK-47
GivePlayerWeapon(playerid, 30, 500);
}
case 4:
{
//sniper
GivePlayerWeapon(playerid, 34, 500);
}
case 5:
{
//pistol
GivePlayerWeapon(playerid, 22, 500);
}
case 6:
{
//parachute
GivePlayerWeapon(playerid, 46, 500);
}
case 7:
{
//MP5
GivePlayerWeapon(playerid, 29, 500);
}
}
}
![Cheesy](images/smilies/biggrin.png)