Some warnings and errors i can't fix. - 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: Some warnings and errors i can't fix. (
/showthread.php?tid=544878)
Some warnings and errors i can't fix. -
Mitchelll - 04.11.2014
Fixed, Thanks everyone!
Re: Some warnings and errors i can't fix. -
Runn3R - 04.11.2014
if(GetPlayerMoney(playerid) => 600)
This is wrong...
Do it like this:
if(GetPlayerMoney(playerid) >= 600)
Re: Some warnings and errors i can't fix. -
Mitchelll - 04.11.2014
Fixed, Thanks everyone!
Re: Some warnings and errors i can't fix. -
Mitchelll - 04.11.2014
Fixed, Thanks everyone!
Re: Some warnings and errors i can't fix. -
Runn3R - 04.11.2014
Holy shit.
pawn Код:
stock WeaponShopShow(playerid, menu)
{
WeaponShopHide(playerid);
switch(menu)
{
case 0:
{
ShowMenuForPlayer(mWeaponShop, playerid);
if(GetPlayerTeam(playerid) == TEAM_USA)
{
TextDrawShowForPlayer(playerid, WS_US);
}
else
{
TextDrawShowForPlayer(playerid, WS_RU);
TextDrawShowForPlayer(playerid, WS_Pistols);
TextDrawShowForPlayer(playerid, WS_Shotguns);
TextDrawShowForPlayer(playerid, WS_SMGs);
TextDrawShowForPlayer(playerid, WS_ARifles);
TextDrawShowForPlayer(playerid, WS_Rifles);
TextDrawShowForPlayer(playerid, WS_Other);
}
}
case 1:
{
ShowMenuForPlayer(mWS_Pistols, playerid);
}
case 2:
{
ShowMenuForPlayer(mWS_Shotguns, playerid);
}
case 3:
{
ShowMenuForPlayer(mWS_SMGs, playerid);
}
case 4:
{
ShowMenuForPlayer(mWS_ARifles, playerid);
}
case 5:
{
ShowMenuForPlayer(mWS_Rifles, playerid);
}
case 6:
{
ShowMenuForPlayer(mWS_Other, playerid);
}
}
TogglePlayerControllable(playerid, 0);
return 1;
}
stock WeaponShopHide(playerid)
{
HideMenuForPlayer(mWeaponShop, playerid);
if(GetPlayerTeam(playerid) == TEAM_USA)
{
TextDrawHideForPlayer(playerid, WS_US);
}
else
{
TextDrawHideForPlayer(playerid, WS_RU);
TextDrawHideForPlayer(playerid, WS_Pistols);
TextDrawHideForPlayer(playerid, WS_Shotguns);
TextDrawHideForPlayer(playerid, WS_SMGs);
TextDrawHideForPlayer(playerid, WS_ARifles);
TextDrawHideForPlayer(playerid, WS_Rifles);
TextDrawHideForPlayer(playerid, WS_Other);
HideMenuForPlayer(mWS_Pistols, playerid);
HideMenuForPlayer(mWS_Shotguns, playerid);
HideMenuForPlayer(mWS_SMGs, playerid);
HideMenuForPlayer(mWS_ARifles, playerid);
HideMenuForPlayer(mWS_Rifles, playerid);
HideMenuForPlayer(mWS_Other, playerid);
TogglePlayerControllable(playerid, 1);
}
return 1;
}
Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:menuid = GetPlayerMenu(playerid);
if(menuid == mWeaponShop)
{
switch(row)
{
case 0: WeaponShopShow(playerid, 1); //(666) : warning 202: number of arguments does not match definition
case 1: WeaponShopShow(playerid, 2); //(667) : warning 202: number of arguments does not match definition
case 2: WeaponShopShow(playerid, 3); //(668) : warning 202: number of arguments does not match definition
case 3: WeaponShopShow(playerid, 4); //(669) : warning 202: number of arguments does not match definition
case 4: WeaponShopShow(playerid, 5); //(670) : warning 202: number of arguments does not match definition
case 5: WeaponShopShow(playerid, 6); //(671) : warning 202: number of arguments does not match definition
}
}
if(menuid == mWS_Pistols)
{ // Missing bracket here..
switch(row)
{
case 0:
{
if(GetPlayerMoney(playerid) >= 300)
{ //Other errors and warnings are on this line.
GivePlayerMoney(playerid, -300);
GivePlayerWeapon(playerid, 22, 100);
}
else
{
SendClientMessage(playerid, red, "ERROR: You don't have enough money to buy this weapon.");
}
WeaponShopShow(playerid, 1);
}
case 1:
{
if(GetPlayerMoney(playerid) >= 350)
{
GivePlayerMoney(playerid, -350);
GivePlayerWeapon(playerid, 23, 100);
}else
{
SendClientMessage(playerid, red, "ERROR: You don't have enough money to buy this weapon.");
}
WeaponShopShow(playerid, 1);
}
case 2:
{
if(GetPlayerMoney(playerid) >= 600)
{
GivePlayerMoney(playerid, -600);
GivePlayerWeapon(playerid, 24, 60);
}
else
{
SendClientMessage(playerid, red, "ERROR: You don't have enough money to buy this weapon.");
}
WeaponShopShow(playerid, 1);
}
}
}
return 1;
}