16.01.2016, 19:56
Bom criei um fs de comprar armas bem simples apenas para testar mais quando abro o menu no jogo clico no menu e nada ocorre e depois de aberto ele nao fecha mais, alguйm sabe o pq isso ocorre ?
#include <a_samp>
#include <zcmd>
#include <Selection>
#define PREV_BG_COLOR2 0xFFFF00AA
#define DIALOG_BG_COLOR 0x4A5A6BBB
#define PREV_BG_COLOR 0x88888899
new gun = mS_INVALID_LISTID;
public OnFilterScriptInit()
{
gun = LoadModelSelectionMenu("WeaponsMenu.txt");
print("Weapon Menu loaded!");
return 1;
}
CMD:menuweapons(playerid, params[])
{
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
return 1;
}
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == gun)
{
if(response)
{
switch(modelid)
{
case 346:
{
if(GetPlayerMoney(playerid) <200) return GameTextForPlayer(playerid, "~r~ No Money", 200, 1);
GivePlayerMoney(playerid, -200), GivePlayerWeapon(playerid, 22, 30);
GameTextForPlayer(playerid, "~r~9 mm", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 347:
{
if(GetPlayerMoney(playerid) <600) return GameTextForPlayer(playerid, "~r~ No Money", 200, 1);
GivePlayerMoney(playerid, -600), GivePlayerWeapon(playerid, 23, 30), GameTextForPlayer(playerid, "~r~Silinced 9mm", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 348:
{
if(GetPlayerMoney(playerid) <1200) return GameTextForPlayer(playerid, "~r~ No Money", 200, 1);
GivePlayerMoney(playerid, -1200), GivePlayerWeapon(playerid, 24, 30), GameTextForPlayer(playerid, "~r~Desert Eagle", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 372:
{
if(GetPlayerMoney(playerid) <300) return GameTextForPlayer(playerid, "~r~ No Money", 200, 1);
GivePlayerMoney(playerid, -300), GivePlayerWeapon(playerid, 32, 30), GameTextForPlayer(playerid, "~r~TEC-9", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 352:
{
if(GetPlayerMoney(playerid) <500) return GameTextForPlayer(playerid, "~r~ No Money", 200, 1);
GivePlayerMoney(playerid, -500), GivePlayerWeapon(playerid, 28, 30), GameTextForPlayer(playerid, "~r~Uzi", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 349:
{
if(GetPlayerMoney(playerid) <600) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -600), GivePlayerWeapon(playerid, 25, 15), GameTextForPlayer(playerid, "~r~Shotgun", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 350:
{
if(GetPlayerMoney(playerid) <800) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -800), GivePlayerWeapon(playerid, 26, 15), GameTextForPlayer(playerid, "~r~Sawnoff Shotgun", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 351:
{
if(GetPlayerMoney(playerid) <1000) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -1000), GivePlayerWeapon(playerid, 27, 15), GameTextForPlayer(playerid, "~r~Combat Shotgun", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 353:
{
if(GetPlayerMoney(playerid) <2000) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -2000), GivePlayerWeapon(playerid, 29, 30), GameTextForPlayer(playerid, "~r~MP5", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 355:
{
if(GetPlayerMoney(playerid) <3500) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -3500), GivePlayerWeapon(playerid, 30, 120), GameTextForPlayer(playerid, "~r~AK-47", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 356:
{
if(GetPlayerMoney(playerid) <4500) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -4500), GivePlayerWeapon(playerid, 31, 120), GameTextForPlayer(playerid, "~r~M4", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 357:
{
if(GetPlayerMoney(playerid) <1000) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -1000), GivePlayerWeapon(playerid, 33, 20), GameTextForPlayer(playerid, "~r~Country Rifle", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
case 358:
{
if(GetPlayerMoney(playerid) <5000) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -5000), GivePlayerWeapon(playerid, 34, 10), GameTextForPlayer(playerid, "~r~Sniper Rifle", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2);
}
}
}
return 1;
}
return 1;
}
Poste o cуdigo para que seja possнvel eu ajuda-lo. Isso й muito fбcil, se posta o cуdigo eu arrumo pra vocк e explico. |
Ok, ajuda ele ai, Eu tenho raiva de pessoas que falam a mesma coisa que outra.
|
#include <a_samp>
#include <zcmd>
#include <mSelection>
new gun = mS_INVALID_LISTID;
public OnFilterScriptInit()
{
gun = LoadModelSelectionMenu("WeaponsMenu.txt");
print("Weapon Menu loaded!");
return 1;
}
CMD:menuweapons(playerid, params[])
{
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
return 1;
}
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == gun)
{
if(response)
{
switch(modelid)
{
case 346:
{
if(GetPlayerMoney(playerid) <200) return GameTextForPlayer(playerid, "~r~ No Money", 200, 1);
GivePlayerMoney(playerid, -200), GivePlayerWeapon(playerid, 22, 30);
GameTextForPlayer(playerid, "~r~9 mm", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 347:
{
if(GetPlayerMoney(playerid) <600) return GameTextForPlayer(playerid, "~r~ No Money", 200, 1);
GivePlayerMoney(playerid, -600), GivePlayerWeapon(playerid, 23, 30), GameTextForPlayer(playerid, "~r~Silinced 9mm", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 348:
{
if(GetPlayerMoney(playerid) <1200) return GameTextForPlayer(playerid, "~r~ No Money", 200, 1);
GivePlayerMoney(playerid, -1200), GivePlayerWeapon(playerid, 24, 30), GameTextForPlayer(playerid, "~r~Desert Eagle", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 372:
{
if(GetPlayerMoney(playerid) <300) return GameTextForPlayer(playerid, "~r~ No Money", 200, 1);
GivePlayerMoney(playerid, -300), GivePlayerWeapon(playerid, 32, 30), GameTextForPlayer(playerid, "~r~TEC-9", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 352:
{
if(GetPlayerMoney(playerid) <500) return GameTextForPlayer(playerid, "~r~ No Money", 200, 1);
GivePlayerMoney(playerid, -500), GivePlayerWeapon(playerid, 28, 30), GameTextForPlayer(playerid, "~r~Uzi", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 349:
{
if(GetPlayerMoney(playerid) <600) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -600), GivePlayerWeapon(playerid, 25, 15), GameTextForPlayer(playerid, "~r~Shotgun", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 350:
{
if(GetPlayerMoney(playerid) <800) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -800), GivePlayerWeapon(playerid, 26, 15), GameTextForPlayer(playerid, "~r~Sawnoff Shotgun", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 351:
{
if(GetPlayerMoney(playerid) <1000) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -1000), GivePlayerWeapon(playerid, 27, 15), GameTextForPlayer(playerid, "~r~Combat Shotgun", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 353:
{
if(GetPlayerMoney(playerid) <2000) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -2000), GivePlayerWeapon(playerid, 29, 30), GameTextForPlayer(playerid, "~r~MP5", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 355:
{
if(GetPlayerMoney(playerid) <3500) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -3500), GivePlayerWeapon(playerid, 30, 120), GameTextForPlayer(playerid, "~r~AK-47", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 356:
{
if(GetPlayerMoney(playerid) <4500) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -4500), GivePlayerWeapon(playerid, 31, 120), GameTextForPlayer(playerid, "~r~M4", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 357:
{
if(GetPlayerMoney(playerid) <1000) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -1000), GivePlayerWeapon(playerid, 33, 20), GameTextForPlayer(playerid, "~r~Country Rifle", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
case 358:
{
if(GetPlayerMoney(playerid) <5000) return GameTextForPlayer(playerid, "~r~No Money", 200, 1);
GivePlayerMoney(playerid, -5000), GivePlayerWeapon(playerid, 34, 10), GameTextForPlayer(playerid, "~r~Sniper Rifle", 200, 1);
ShowModelSelectionMenu(playerid, gun, "Weapons menu");
}
}
}
else SendClientMessage(playerid, -1, "Fechou o Menu!");
}
return 1;
}