27.05.2016, 09:09
try this
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(listitem == 0)
{
if(Materiali[playerid] > 399)
{
SendClientMessage(playerid, COLOUR_WHITE, "You have crafted yourself a desert eagle.");
GivePlayerWeapon(playerid, 24, 9999999);
return 1;
}
else
{
SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that.");
return 1;
}
}
if(listitem == 1)
{
if(Materiali[playerid] > 149)
{
SendClientMessage(playerid, COLOUR_WHITE, "You have crafted yourself a pump-action shotgun.");
GivePlayerWeapon(playerid, 25, 9999999);
return 1;
}
else
{
SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that.");
return 1;
}
}
if(listitem == 2)
{
if(Materiali[playerid] > 249)
{
SendClientMessage(playerid, COLOUR_WHITE, "You have crafted yourself a MP5.");
GivePlayerWeapon(playerid, 29, 9999999);
return 1;
}
else
{
SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that.");
return 1;
}
}
if(listitem == 3)
{
if(Materiali[playerid] > 499)
{
SendClientMessage(playerid, COLOUR_WHITE, "You have crafted yourself a M4 carbine.");
GivePlayerWeapon(playerid, 31, 9999999);
return 1;
}
else
{
SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that.");
return 1;
}
}
if(listitem == 4)
{
if(Materiali[playerid] > 549)
{
SendClientMessage(playerid, COLOUR_WHITE, "You have crafted yourself a Spas-12.");
GivePlayerWeapon(playerid, 27, 9999999);
return 1;
}
else
{
SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that.");
return 1;
}
}
}