Symbol Already Defined Error
#1

Hey, I have problem when I compiling the script, here are the codes.

How to fix it?

Код:
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130018) : warning 217: loose indentation
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130024) : warning 215: expression has no effect
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130033) : warning 217: loose indentation
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130039) : warning 215: expression has no effect
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130042) : warning 209: function "cmd_buymats" should return a value
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130043) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130045) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130046) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130048) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130050) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130051) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130056) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130058) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130060) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130061) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130063) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130065) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130066) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130071) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130073) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130075) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130076) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130078) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130080) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130081) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130086) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130088) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130090) : error 021: symbol already defined: "SendClientMessageEx"
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130091) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130093) : error 010: invalid function or declaration
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/IGRP.pwn(130095) : error 021: symbol already defined: "SendClientMessageEx"

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


26 Errors.
PHP код:
CMD:buymats(playeridparams[])
{
        new 
choice[32];
        if(
sscanf(params"s[32]"choice))
        {
            
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /buymats");
            
SendClientMessageEx(playeridCOLOR_GRAD2"Available amounts/prices: 1000 ($1200), 5000 ($6000), 15000 ($18000), 25000 ($30000), 45000 ($54000), 100000 ($120000)");
            return 
1;
        }
        new 
amount GetPlayerCash(playerid);
        if (
amount 10)
            {
            
SendClientMessageEx(playeridCOLOR_GRAD2"You don't have enough money to buy any mats!");
            return 
1;
            }
        if (
IsPlayerInRangeOfPoint(playerid10.0,2105.4258,-1886.2653,13.5469) || IsPlayerInRangeOfPoint(playerid10.0,534.2360,913.0679,-42.9609)) // Point to Pickup Materials
        
{
            if(
strcmp(choice"1000"true) == 0)
            {
                    
SendClientMessageEx(playeridCOLOR_GREY"There are not enough materials in the storage, they need deliveries!");
                    return 
1;
                }
                if(
GetPlayerCash(playerid) < 1200)
                {
                    
SendClientMessageEx(playeridCOLOR_GREY"You can't afford the cost of materials!");
                    return 
1;
                }
                
GivePlayerCash(playerid, -1200);
                
PlayerInfo[playerid][pMats];
                
PlayerInfo[playerid][pMats] = 1000;
                
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* You bought 1000 Materials Packages for $1200.");
            }
            else if(
strcmp(choice"5000"true) == 0)
            {
                    
SendClientMessageEx(playeridCOLOR_GREY"There are not enough materials in the storage, they need deliveries!");
                    return 
1;
                }
                if(
GetPlayerCash(playerid) < 6000)
                {
                    
SendClientMessageEx(playeridCOLOR_GREY"You can't afford the cost of materials!");
                    return 
1;
                }
                
GivePlayerCash(playerid, -6000);
                
PlayerInfo[playerid][pMats];
                
PlayerInfo[playerid][pMats] = 5000;
                
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* You bought 5000 Materials Packages for $6000.");
            }
            else if(
strcmp(choice"15000"true) == 0)
            {
                    
SendClientMessageEx(playeridCOLOR_GREY"There are not enough materials in the storage, they need deliveries!");
                    return 
1;
                }
                if(
GetPlayerCash(playerid) < 18000)
                {
                    
SendClientMessageEx(playeridCOLOR_GREY"You can't afford the cost of materials!");
                    return 
1;
                }
                
GivePlayerCash(playerid, -18000);
                
PlayerInfo[playerid][pMats];
                
PlayerInfo[playerid][pMats] = 15000;
                
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* You bought 15000 Materials Packages for $18000.");
            }
            else if(
strcmp(choice"25000"true) == 0)
            {
                    
SendClientMessageEx(playeridCOLOR_GREY"There are not enough materials in the storage, they need deliveries!");
                    return 
1;
                }
                if(
GetPlayerCash(playerid) < 30000)
                {
                    
SendClientMessageEx(playeridCOLOR_GREY"You can't afford the cost of materials!");
                    return 
1;
                }
                
GivePlayerCash(playerid, -30000);
                
PlayerInfo[playerid][pMats];
                
PlayerInfo[playerid][pMats] = 25000;
                
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* You bought 25000 Materials Packages for $30000.");
            }
            else if(
strcmp(choice"45000"true) == 0)
            {
                    
SendClientMessageEx(playeridCOLOR_GREY"There are not enough materials in the storage, they need deliveries!");
                    return 
1;
                }
                if(
GetPlayerCash(playerid) < 54000)
                {
                    
SendClientMessageEx(playeridCOLOR_GREY"You can't afford the cost of materials!");
                    return 
1;
                }
                
GivePlayerCash(playerid, -54000);
                
PlayerInfo[playerid][pMats];
                
PlayerInfo[playerid][pMats] = 45000;
                
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* You bought 45000 Materials Packages for $54000.");
            }
            else if(
strcmp(choice"100000"true) == 0)
            {
                    
SendClientMessageEx(playeridCOLOR_GREY"There are not enough materials in the storage, they need deliveries!");
                    return 
1;
                }
                if(
GetPlayerCash(playerid) < 120000)
                {
                    
SendClientMessageEx(playeridCOLOR_GREY"You can't afford the cost of materials!");
                    return 
1;
                }
                
GivePlayerCash(playerid, -120000);
                
PlayerInfo[playerid][pMats];
                
PlayerInfo[playerid][pMats] = 100000;
                
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"* You bought 100000 Materials Packages for $120000.");
            }
        }
        else
        {
            return 
SendClientMessageEx(playeridCOLOR_GREY"You are not near the /buymats locations!");
        }
   return 
1;

Reply
#2

Show sendclirntmessageex stock
Reply
#3

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Show sendclirntmessageex stock
Код:
stock SendClientMessageEx(playerid, color, string[])
{
	if(InsideMainMenu{playerid} == 1 || InsideTut{playerid} == 1 || ActiveChatbox[playerid] == 0)
		return 0;
Reply
#4

Is there more then that?
Reply
#5

Did you leave any brackets open?
Reply
#6

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Did you leave any brackets open?
No, I didn't check out the codes and see.
Reply
#7

Give the complete code of stock sendclientmessageex
Reply
#8

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Give the complete code of stock sendclientmessageex
Код:
stock SendClientMessageEx(playerid, color, string[])
{
	if(InsideMainMenu{playerid} == 1 || InsideTut{playerid} == 1 || ActiveChatbox[playerid] == 0)
		return 0;

	else SendClientMessage(playerid, color, string);
	return 1;
}

stock SendClientMessageToAllEx(color, string[])
{
	foreach(new i: Player)
	{
		if(InsideMainMenu{i} == 1 || InsideTut{i} == 1 || ActiveChatbox[i] == 0) {}
		else SendClientMessage(i, color, string);
	}
	return 1;
}
This is it plus AllEx.
Reply
#9

The way you are using else if is wrong. Also you have many extra } in your code
Reply
#10

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
The way you are using else if is wrong. Also you have many extra } in your code
Can you edit the code and send it to me good?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)