I NEED HELP FOR MY CODE
#1

hi everyone !! i posted this thread because i reall need an expert to see my script and tell me the problem because when i compile i have 10 errors.

Here's the code:

#include <a_samp>

#define DIALOG_WEAPONS 3

// In some command
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "Desert Eagle\nAK-47\nCombat Shotgun\n Sniper Rifle", "Select", "Close");

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/weapons", true))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your weapon", "Desert Eagle ($10000)\nAK-47 ($20000)\nCombat Shotgun($20000)\nSniper Rifle ($50000)", "Purchase", "Cancel");
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_WEAPONS)
{
if(response) // If they clicked 'Select' or double-clicked a weapon
{
// Give them the weapon
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, WEAPON_DESERT EAGLE, 14); // Give them a desert eagle
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -10000);
}
case 1:
{
GivePlayerWeapon(playerid, WEAPON_AK-47, 120); // Give them an AK-47
if(GetPlayerMoney(playerid) < 20000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -20000);
}
case 2:
{
GivePlayerWeapon(playerid, WEAPON_COMBAT SHOTGUN, 2; // Give them a Combat Shotgun
if(GetPlayerMoney(playerid) < 20000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -20000);
case 3:
{
GivePlayerWeapon(playerid, WEAPON_SNIPER RIFLE, 34); // Give them a Sniper Rifle
if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -50000);
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}

return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}

and here are the compiling errors :

C:\Users\Propriйtaire\Desktop\k.pwn(6) : error 021: symbol already defined: "ShowPlayerDialog"
C:\Users\Propriйtaire\Desktop\k.pwn(16) : error 029: invalid expression, assumed zero
C:\Users\Propriйtaire\Desktop\k.pwn(16) : error 004: function "OnDialogResponse" is not implemented
C:\Users\Propriйtaire\Desktop\k.pwn(1 : error 017: undefined symbol "dialogid"
C:\Users\Propriйtaire\Desktop\k.pwn(20) : error 017: undefined symbol "response"
C:\Users\Propriйtaire\Desktop\k.pwn(23) : error 017: undefined symbol "listitem"
C:\Users\Propriйtaire\Desktop\k.pwn(27) : error 017: undefined symbol "WEAPON_DESERT"
C:\Users\Propriйtaire\Desktop\k.pwn(27) : error 017: undefined symbol "EAGLE"
C:\Users\Propriйtaire\Desktop\k.pwn(27) : error 029: invalid expression, assumed zero
C:\Users\Propriйtaire\Desktop\k.pwn(27) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


10 Errors.



Please can you help me figure out how to repair my script ? If you can could you post me a repaired version of my script and by repaired i mean a version with no errors thanks
Reply


Messages In This Thread
I NEED HELP FOR MY CODE - by brandypol - 25.02.2014, 23:38
Re: I NEED HELP FOR MY CODE - by brandypol - 25.02.2014, 23:41
Re: I NEED HELP FOR MY CODE - by Threshold - 26.02.2014, 00:53

Forum Jump:


Users browsing this thread: 1 Guest(s)