Автор: Tobias
В public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
Code: Select all
if(dialogid == 900 && response)
{
new swords[] = { 18649,18650,18648,18647,18652,18651 };
SetPlayerAttachedObject(playerid, 0, model_array[ listitem ], 6, 0.07000, 0.03000, 0.80000, 90.000000, 0.000000, 0.000000, 1.3, 0.7, 2.3);
SetPVarInt(playerid,"Sword",1);
return GivePlayerWeapon(playerid, 8, 1);
}
в public OnPlayerCommandText(playerid, cmdtext[])
Code: Select all
if (strcmp(cmdtext, "/lightsaber", true)==0)
{
if(GetPVarInt(playerid,"Sword") == 0) return ShowPlayerDialog(playerid,900, DIALOG_STYLE_LIST, "Light Sabres", "Green\nYellow\nBlue\nRed\nWhite\nPink", "Done!", "Quit");
}
else
{
RemovePlayerAttachedObject(playerid,0);
return SetPVarInt(playerid,"Sword",0);
}