Ammunation System Fix
#1

Quote:

CMD:buyguns(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 40, 286.148986,-40.644397,1001.515625) || IsPlayerInRangeOfPoint(playerid, 40, 286.800994,-82.547599,1001.515625) || IsPlayerInRangeOfPoint(playerid, 40, 296.919982,-108.071998,1001.515625) || IsPlayerInRangeOfPoint(playerid, 40, 314.820983,-141.431991,999.601562) || IsPlayerInRangeOfPoint(playerid, 40, 316.524993,-167.706985,999.593750))
ShowPlayerDialog(playerid, DIALOGWEAPONS, DIALOG_STYLE_LIST, "Hello, what guns can I get you?", "Deagle(15k)\nShotgun(2.5k)\nMP5(5k)\nSpas12(170k) \n(50k)\n(60k)\nSniper(150k)\nHalf vest(10k)\nFull vest(20k)","Buy","Cancel");
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOGWEAPONS)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_GRAD, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GRAD, "You bought a deagle for 15k!");
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid,24, 9999999);
}
case 1:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_GRAD, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GRAD, "You bought a shotgun for 2.5k!");
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 25, 9999999);
}
case 2:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_GRAD, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GRAD, "You bought an MP5 for 5k!");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 29 ,9999999);
}
case 3:
{
if(GetPlayerMoney(playerid) <170000) return SendClientMessage(playerid, COLOR_GRAD, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GRAD, "You bought a spas12 for 170k!");
GivePlayerMoney(playerid, -170000);
GivePlayerWeapon(playerid, 27, 9999999);
}
case 4:
{
if(GetPlayerMoney(playerid) <50000) return SendClientMessage(playerid, COLOR_GRAD, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GRAD, "You bought an for 50k!");
GivePlayerMoney(playerid, -50000);
GivePlayerWeapon(playerid,30 ,9999999);
}
case 5:
{
if(GetPlayerMoney(playerid) <60000) return SendClientMessage(playerid, COLOR_GRAD, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GRAD, "You bought an for 60k!");
GivePlayerMoney(playerid, -60000);
GivePlayerWeapon(playerid, 31, 9999999);
}
case 6:
{
if(GetPlayerMoney(playerid) <150000) return SendClientMessage(playerid, COLOR_GRAD, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GRAD, "You bought a sniper for 150k!");
GivePlayerMoney(playerid, -150000);
GivePlayerWeapon(playerid, 34, 9999999);
}
case 7:
{
if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_GRAD, "You don't have enough money to buy this item!");

new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_GRAD,"You already have a full vest!");
SendClientMessage(playerid, COLOR_GRAD, "You bought a half vest for 10k!");
GivePlayerMoney(playerid, -10000);
SetPlayerArmour(playerid, 50);
}
case 8:
{
if(GetPlayerMoney(playerid) <20000) return SendClientMessage(playerid, COLOR_GRAD, "You don't have enough money to buy this item!");

new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_GRAD, "You already have a full vest!");
SendClientMessage(playerid, COLOR_GRAD, "You bought a full vest for 20k!");
GivePlayerMoney(playerid, -20000);
SetPlayerArmour(playerid, 100);
}

}
return 0;
}
}
return 1;
}

Fix this, Will +rep here is the error code :
Quote:

C:\Users\User\Desktop\Endless\gamemodes\HRP_9.0.pw n(60589) : error 021: symbol already defined: "OnDialogResponse"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Reply
#2

"public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])"

You have this thing already defined somewhere in your script, I'm not sure if you copy and pasted it, but search in your script for another OnDialogResponse and fix that to, search something in your script use Ctrl + F

So you have 2x public OnDialogResponse(bla bla) you have to remove one
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)