20.02.2016, 20:18
hi i get error in these lines
error 017: undefined symbol "playerid"
error 021: symbol already defined: "S@@_OnDialogResponse"
Full Code:
PHP код:
ShowPlayerDialog(playerid, 67, DIALOG_STYLE_LIST, "Weapon shop", "Chainsaw\nDesert Eagle\nSawnoff Shotgun/nMicro SMG\nMP5\nSniper Rifle\nShotgun/n9mm", "Buy", "Cancel");
return 1;
}
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{ // error
if(dialogid == 67)
{
if(!response)
return 1;
switch(listitem)
{
Full Code:
PHP код:
CMD:weapons(players, params[])
{
ShowPlayerDialog(playerid, 67, DIALOG_STYLE_LIST, "Weapon shop", "Chainsaw\nDesert Eagle\nSawnoff Shotgun/nMicro SMG\nMP5\nSniper Rifle\nShotgun/n9mm", "Buy", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 67)
{
if(!response)
return 1;
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 9, 1);
SendClientMessage(playerid, 0x0000FFAA, "You have recieved the weapon.");
}
case 1:
{
GivePlayerWeapon(playerid, 24, 9999);
SendClientMessage(playerid, 0x33FF00AA, "You Have Recieved Your Weapon.");
}
case 2:
{
GivePlayerWeapon(playerid, 26, 9999);
SendClientMessage(playerid, 0x00FFFFAA, "You Have Recieved Your Weapon.");
}
case 3:
{
GivePlayerWeapon(playerid, 28, 9999);
SendClientMessage(playerid, 0x6600FFAA, "You Have Recieved Your Weapon.");
}
case 4:
{
GivePlayerWeapon(playerid, 29, 9999);
SendClientMessage(playerid, 0x99FF00AA, "You Have Recieved Your Weapon.");
}
case 5:
{
GivePlayerWeapon(playerid, 26, 9000);
SendClientMessage(playerid, 0x999999AA, "You Have Recieved Your Weapon.");
}
case 6:
{
GivePlayerWeapon(playerid, 34, 9000);
SendClientMessage(playerid, 0xCC0000AA, "You Have Recieved Your Weapon.");
}
case 7:
{
GivePlayerWeapon(playerid, 25, 9999);
SendClientMessage(playerid, 0xFF00FFAA, "You Have Recieved Your Weapon.");
}
case 8:
{
GivePlayerWeapon(playerid, 22, 9999);
SendClientMessage(playerid, 0xCCFF00AA, "You Have Recieved Your Weapon.");
}
}
}
return 1;
}