25.10.2012, 10:31
PHP код:
#include <a_samp>
//:...................
#define DIALOG_WEAPONS 3
//:...................
new weapon;
//:...................
public OnGameModeInit()
{
weapon = CreatePickup(1274, 2, 0.0, 0.0, 9.0);//Here goes the coordinates
return 1;
}
//:...................//:...................
//:...................
//:...................
//:...................
//:...................
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == weapon)
{
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "Deagle\nAK47\nShotgspa", "Buy", "Quit");
}// The mistake was here the bracket was not closed :)
return 1;
}
//:...................
//:...................
//:...................
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_WEAPONS)
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 29, 114);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 30, 120);
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 27, 280);
}
}
return 1;
}
return 0;
}