03.02.2010, 21:15
example i wanna when player type /weapons to get menu to chose weapon i will script but i dont know how to make menu can someone help me is there any program to do it or i must make it manualy?
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/shop", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Welcome To Shop", "Health\nArmor\nNrg-500", "Accept", "Cancel");
return 1;
}
return 0;
}
if(dialogid == 1 && response)
{
switch(listitem)
{
case 0://health
{
if(GetPlayerMoney(playerid) >=1000)
{
GivePlayerMoney(playerid,-1000);
SetPlayerHealth(playerid,100.0);
SendClientMessage(playerid,LIGHTGREEN,"=Shop= Thank you For Purchasing!");
}
else
{
SendClientMessage(playerid,LIGHTGREEN,"=Shop= You Do Not Have Enough Money For That Item");
}
}
case 1://armor
{
if(GetPlayerMoney(playerid) >=1000)
{
GivePlayerMoney(playerid,-1000);
SetPlayerArmour(playerid,100.0);
SendClientMessage(playerid,LIGHTGREEN,"=Shop= Thank you For Purchasing!");
}
else
{
SendClientMessage(playerid,LIGHTGREEN,"=Shop= You Do Not Have Enough Money For That Item");
}
}
case 2://nrg
{
if(GetPlayerMoney(playerid) >=2000)
{
GivePlayerMoney(playerid,-1000);
SpawnVehicle(playerid, 522);
SendClientMessage(playerid,LIGHTGREEN,"=Shop= Thank you For Purchasing!");
}
else
{
SendClientMessage(playerid,LIGHTGREEN,"=Shop= You Do Not Have Enough Money For That Item");
}
}
}
}
return 1;
}