CMD:buyweapon(playerid, params[]) { if(!IsAtammoshop(playerid)) { SendClientMessage(playerid, COLOR_GREY, " You are not in a Ammunation Shop"); return 1; } else { ShowPlayerDialog(playerid, AMMOSTOREMENU, DIALOG_STYLE_LIST, "Ammunation Shop", "Pump-Shotgun (5000)\nDeagle Eagle (35000)\nVest (3000))", "Buy", "Cancel"); } return 1; } |
pFireArmsLic |
CMD:buyweapon(playerid, params[])
{
if(!IsAtammoshop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " You are not in a Ammunation Shop");
return 1;
}
else if(Player[playerid][pFireArmsLic]==1)
{
ShowPlayerDialog(playerid, AMMOSTOREMENU, DIALOG_STYLE_LIST, "Ammunation Shop", "Pump-Shotgun (5000)\nDeagle Eagle (35000)\nVest (3000))", "Buy", "Cancel");
}
return 1;
}
SC-RP\gamemodes\SouthcarolinaRP.pwn(9276) : error 017: undefined symbol "Player" SC-RP\gamemodes\SouthcarolinaRP.pwn(9276) : warning 215: expression has no effect SC-RP\gamemodes\SouthcarolinaRP.pwn(9276) : error 001: expected token: ";", but found "]" SC-RP\gamemodes\SouthcarolinaRP.pwn(9276) : error 029: invalid expression, assumed zero SC-RP\gamemodes\SouthcarolinaRP.pwn(9276) : fatal error 107: too many error messages on one line 4 Errors. |
CMD:buyweapon(playerid, params[])
{
if(!IsAtammoshop(playerid)) return SendClientMessage(playerid, COLOR_GREY, " You are not in a Ammunation Shop");
if(!PlayerInfo[playerid][pFireArmsLic]) return 0;
ShowPlayerDialog(playerid, AMMOSTOREMENU, DIALOG_STYLE_LIST, "Ammunation Shop", "Pump-Shotgun (5000)\nDeagle Eagle (35000)\nVest (3000))", "Buy", "Cancel");
return 1;
}
And also you need change withyou player enum variables to get it working, if you get any errors when post here.
|
I want make it restricted just who got a weapon licenses can buy.
|
CMD:buyweapon(playerid, params[]) { if(!IsAtammoshop(playerid)) { SendClientMessage(playerid, COLOR_GREY, " You are not in a Ammunation Shop"); return 1; } else if({variable for weapon license} == 0) return SendClientMessage(playerid, -1, "You don't have a weapon license."); else { ShowPlayerDialog(playerid, AMMOSTOREMENU, DIALOG_STYLE_LIST, "Ammunation Shop", "Pump-Shotgun (5000)\nDeagle Eagle (35000)\nVest (3000))", "Buy", "Cancel"); } return 1; } |