What wrong with this [++rep]
#1

Код:
	if ( strcmp( cmd, "/dfaction", true )== 0)//testdealers
    {
		new mmm;
		new tmp[256];
		tmp = strtok(cmdtext, idx);
		mmm = strval(tmp);
		if(!strlen(tmp)) return SendClientMessage(playerid, DENN, "[SERVER] Usage: /dfaction [Money]");
		if(mmm <= 0) return SendClientMessage(playerid, DENN, "[SERVER] Usage: /dfaction [Money]");
        if(team[playerid] == 3)//dealers
        {
        	format(file, sizeof(file), Faction\\DEALERS.ini);
        	dini_IntSet(file, "BANK", dini_Int(file, "BANK")+mmm);
		    new string[80];
		    format(string, sizeof(string), "[SERVER] You have Deposit %d in your FACTION ACCOUNT.", mmm );
		    return SendClientMessage(playerid, ACC, string);
		}
compilation errors



Код:
C:\Users\adil\Desktop\0.3e\gamemodes\newgame.pwn(1465) : error 017: undefined symbol "Faction"
C:\Users\adil\Desktop\0.3e\gamemodes\newgame.pwn(1465) : error 029: invalid expression, assumed zero
C:\Users\adil\Desktop\0.3e\gamemodes\newgame.pwn(1465) : error 029: invalid expression, assumed zero
C:\Users\adil\Desktop\0.3e\gamemodes\newgame.pwn(1465) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#2

If you have faction defined try the code below and reply what happens.
Код:
	if ( strcmp( cmd, "/dfaction", true )== 0)//testdealers
    {
		new mmm;
		new tmp[256];
                new Faction;
		tmp = strtok(cmdtext, idx);
		mmm = strval(tmp);
		if(!strlen(tmp)) return SendClientMessage(playerid, DENN, "[SERVER] Usage: /dfaction [Money]");
		if(mmm <= 0) return SendClientMessage(playerid, DENN, "[SERVER] Usage: /dfaction [Money]");
        if(team[playerid] == 3)//dealers
        {
        	format(file, sizeof(file), Faction\\DEALERS.ini);
        	dini_IntSet(file, "BANK", dini_Int(file, "BANK")+mmm);
		    new string[80];
		    format(string, sizeof(string), "[SERVER] You have Deposit %d in your FACTION ACCOUNT.", mmm );
		    return SendClientMessage(playerid, ACC, string);
		}
Reply
#3

well actualy i'm not looking for a simple code ! if you can explain what u changed and why pleas ! cause this is just s small code of my script and i have lot more ! i must know where the problem came from in order to fix it all
thnks
Reply
#4

like you have mmm in the cmd in many places and at the top after the command script is started you have
Код:
new mmm;
But if you remove that you are going to get Undefined Symbol "mmm".You are not getting it as you included it in the command so happens the same with the Faction you surely sud have new Faction defined in the top.I am not an expert in scripting so can explain just this much.
Reply
#5

well i found the a solution (adding new faction didn't work )
i just defiend the different location of the file at the top of the script and now it's working better thnks any way i'll add +rep for trying help me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)