SA-MP Forums Archive
Help me. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me. (/showthread.php?tid=531541)



Help me. - Simoer - 13.08.2014

Quote:

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;
}

Quote:

pFireArmsLic

I want make it restricted just who got a weapon licenses can buy.


Re: Help me. - Simoer - 13.08.2014

No one?


Re: Help me. - GGW - 13.08.2014

i Think this One Should Work.

PHP код:
CMD:buyweapon(playeridparams[])
{
if(!
IsAtammoshop(playerid))
{
SendClientMessage(playeridCOLOR_GREY" You are not in a Ammunation Shop");
return 
1;
}
else if(
Player[playerid][pFireArmsLic]==1)
{
ShowPlayerDialog(playeridAMMOSTOREMENUDIALOG_STYLE_LIST"Ammunation Shop""Pump-Shotgun (5000)\nDeagle Eagle (35000)\nVest (3000))""Buy""Cancel");
}
return 
1;




Re: Help me. - MacT - 13.08.2014

And also you need change withyou player enum variables to get it working, if you get any errors when post here.


Re: Help me. - Simoer - 13.08.2014

Quote:

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.

lawl


Re: Help me. - Norrin - 13.08.2014

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;
}


Re: Help me. - IceBilizard - 13.08.2014

pawn Код:
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;
}



Re: Help me. - GGW - 13.08.2014

Quote:
Originally Posted by MacT
Посмотреть сообщение
And also you need change withyou player enum variables to get it working, if you get any errors when post here.
You need to Do That To Fix your Errors if you want to use my codes.


Re: Help me. - Norrin - 13.08.2014

Quote:
Originally Posted by Simoer
Посмотреть сообщение
I want make it restricted just who got a weapon licenses can buy.
Do you have a variable for weapon licenses?


Re: Help me. - Simoer - 13.08.2014

Quote:

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;
}

Thank you..