SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 09/09/2010, 01:34 AM   #1
••• ĤÁĶÁM •••
Huge Clucker
 
••• ĤÁĶÁM •••'s Avatar
 
Join Date: Aug 2010
Location: C:/windows/system32/hakam.dll
Posts: 275
Reputation: 0
Default [ERRORS] Errors appear after adding a Gang System.

Okay, before I start this simple request from everyone. Please do not waste your time telling me to use the search button, because I wouldn't create this thread if I did not use it, or find a solution, and get it working.

It is either you help, or just get out of the thread and stop wasting your time, because it won't help you.

Back to the thread, I'm having some problems while I am compiling the script, the errors are:

Code:
C:\Users\rodi\Desktop\LV-DM\gamemodes\lvdm.pwn(540) : error 003: declaration of a local variable must appear in a compound block
C:\Users\rodi\Desktop\LV-DM\gamemodes\lvdm.pwn(540) : warning 217: loose indentation
C:\Users\rodi\Desktop\LV-DM\gamemodes\lvdm.pwn(540) : error 017: undefined symbol "tmp"
C:\Users\rodi\Desktop\LV-DM\gamemodes\lvdm.pwn(540) : warning 215: expression has no effect
C:\Users\rodi\Desktop\LV-DM\gamemodes\lvdm.pwn(540) : error 001: expected token: ";", but found "]"
C:\Users\rodi\Desktop\LV-DM\gamemodes\lvdm.pwn(540) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
I'm pretty 65% sure that you guys can help me out to solve this without seeing the actual code. If you're willing to see a actual code, then you can just turn your back off and goto a another thread to steal their codes. You can actually keep reading this if you're really trusted in SA-MP, just hit me up a private message.
__________________
I don't care.
••• ĤÁĶÁM ••• is offline  
Old 09/09/2010, 01:35 AM   #2
[UG]Scripter
Huge Clucker
 
[UG]Scripter's Avatar
 
Join Date: Aug 2010
Location: Perth, Western Australia
Posts: 370
Reputation: 5
Default Re: [ERRORS] Errors appear after adding a Gang System.

Please post line 540
__________________
UG Scripter ( Formerly State_Trooper ).

" ...To Protect & Serve..." Proud Supporter of Law Enforcement

[UG]Scripter is offline  
Old 09/09/2010, 02:11 AM   #3
••• ĤÁĶÁM •••
Huge Clucker
 
••• ĤÁĶÁM •••'s Avatar
 
Join Date: Aug 2010
Location: C:/windows/system32/hakam.dll
Posts: 275
Reputation: 0
Default Re: [ERRORS] Errors appear after adding a Gang System.

pawn Code:
if (strcmp("/gang", cmdtext, true, 10) == 0)
            new tmp[256]; //Line 540
            new gangcmd, gangnum;
            tmp = strtok(cmdtext, idx);

I'm kind-of sure that the problem isn't from that line, it's from another line but this line is attempting to failure it or crash it?
__________________
I don't care.
••• ĤÁĶÁM ••• is offline  
Old 09/09/2010, 02:13 AM   #4
[UG]Scripter
Huge Clucker
 
[UG]Scripter's Avatar
 
Join Date: Aug 2010
Location: Perth, Western Australia
Posts: 370
Reputation: 5
Default Re: [ERRORS] Errors appear after adding a Gang System.

if(strcmp(cmdtext, "/gang", true) == 0)
Try that
__________________
UG Scripter ( Formerly State_Trooper ).

" ...To Protect & Serve..." Proud Supporter of Law Enforcement

[UG]Scripter is offline  
Old 09/09/2010, 02:16 AM   #5
••• ĤÁĶÁM •••
Huge Clucker
 
••• ĤÁĶÁM •••'s Avatar
 
Join Date: Aug 2010
Location: C:/windows/system32/hakam.dll
Posts: 275
Reputation: 0
Default Re: [ERRORS] Errors appear after adding a Gang System.

Quote:
Originally Posted by [UG]Scripter View Post
if(strcmp(cmdtext, "/gang", true) == 0)
Try that
No luck, anyone else could help?
__________________
I don't care.
••• ĤÁĶÁM ••• is offline  
Old 09/09/2010, 02:20 AM   #6
[UG]Scripter
Huge Clucker
 
[UG]Scripter's Avatar
 
Join Date: Aug 2010
Location: Perth, Western Australia
Posts: 370
Reputation: 5
Default Re: [ERRORS] Errors appear after adding a Gang System.

Can you post the Entire Command.

Then copy and paste the affected line below all th code leaving it in the full code.
__________________
UG Scripter ( Formerly State_Trooper ).

" ...To Protect & Serve..." Proud Supporter of Law Enforcement

[UG]Scripter is offline  
Old 09/09/2010, 02:23 AM   #7
Calgon
Godfather
 
Calgon's Avatar
 
Join Date: Jan 2009
Posts: 6,476
Reputation: 1126
Default Re: [ERRORS] Errors appear after adding a Gang System.

pawn Code:
if(strcmp(cmdtext, "/gang", true) == 0) {
// code
}
Calgon is offline  
Old 09/09/2010, 02:29 AM   #8
••• ĤÁĶÁM •••
Huge Clucker
 
••• ĤÁĶÁM •••'s Avatar
 
Join Date: Aug 2010
Location: C:/windows/system32/hakam.dll
Posts: 275
Reputation: 0
Default Re: [ERRORS] Errors appear after adding a Gang System.

Quote:
Originally Posted by Calgon View Post
pawn Code:
if(strcmp(cmdtext, "/gang", true) == 0) {
// code
}
No luck. Tried that too. About [UG]Scripter, I'll give it a go and give you the actual code.

pawn Code:
if(strcmp(cmdtext, "/gang", true) == 0)
            new tmp[256];
            new gangcmd, gangnum;
            tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gang [create/join/invite/quit] [name/number]");
            return 1;
        }
        giveplayerid = strval(tmp);

        if(strcmp(tmp, "create", true)==0)
            gangcmd = 1;
        else if(strcmp(tmp, "invite", true)==0)
            gangcmd = 2;
        else if(strcmp(tmp, "join", true)==0)
            gangcmd = 3;
        else if(strcmp(tmp, "quit", true)==0)
            gangcmd = 4;

        tmp = strtok(cmdtext, idx);
        if(gangcmd < 3 && !strlen(tmp)) {
            if(gangcmd==0)
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gang [create/join/invite/quit] [name/number]");
            else if(gangcmd==1)
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gang [create] [name]");
            else if(gangcmd==2)
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gang [invite] [playerID]");
            return 1;
        }

        //Create Gang//
        if(gangcmd==1) {
            if(playerGang[playerid]>0) {
                SendClientMessage(playerid, COLOR_RED, "You are already in a gang!");
                return 1;
            }

            for(new i = 1; i < MAX_GANGS; i++) {
                if(gangInfo[i][0]==0) {
                    //name gang
                    format(gangNames[i], MAX_GANG_NAME, "%s", tmp);
                    //Gang exists
                    gangInfo[i][0]=1;
                    //There is one member
                    gangInfo[i][1]=1;
                    //Gang color is player's color
                    gangInfo[i][2]=playerColors[playerid];

                    //Player is the first gang member
                    gangMembers[i][0] = playerid;
                    format(string, sizeof(string),"You have created the gang '%s' (id: %d)", gangNames[i], i);
                    SendClientMessage(playerid, COLOR_GREEN, string);

                    playerGang[playerid]=i;

                    return 1;
                }
            }

            return 1;

        //Join Gang//
        } else if (gangcmd==3) {
            gangnum = gangInvite[playerid];

            if(playerGang[playerid]>0) {
                SendClientMessage(playerid, COLOR_RED, "You are already in a gang!");
                return 1;
            }
            if(gangInvite[playerid]==0) {
                SendClientMessage(playerid, COLOR_RED, "You have not been invited to a gang.");
                return 1;
            }
            if(gangInfo[gangnum][0]==0) {
                SendClientMessage(playerid, COLOR_RED, "That gang does not exist!");
                return 1;
            }

            if(gangInfo[gangnum][1] < MAX_GANG_MEMBERS) {
                new i = gangInfo[gangnum][1];

                gangInvite[playerid]=0;

                gangMembers[gangnum][i] = playerid;

                GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
                for(new j = 0; j < gangInfo[gangnum][1]; j++) {
                    format(string, sizeof(string),"%s has joined your gang.", sendername);
                    SendClientMessage(gangMembers[gangnum][j], COLOR_ORANGE, string);
                }

                gangInfo[gangnum][1]++;
                playerGang[playerid] = gangnum;

                SetPlayerColor(playerid,gangInfo[gangnum][2]);

                format(string, sizeof(string),"You have joined the gang '%s' (id: %d)", gangNames[gangnum], gangnum);
                SendClientMessage(playerid, COLOR_GREEN, string);

                return 1;
            }

            SendClientMessage(playerid, COLOR_RED, "That gang is full.");
            return 1;

        //Invite to Gang//
        } else if (gangcmd==2) {
            giveplayerid = strval(tmp);

            if(playerGang[playerid]==0) {
                SendClientMessage(playerid, COLOR_RED, "You are not in a gang!");
                return 1;
            }
//          if(gangMembers[playerGang[playerid]][0]!=playerid) {
//              SendClientMessage(playerid, COLOR_RED, "You need to be the gang leader to send an invite.");
//              return 1;
//          }

            if(IsPlayerConnected(giveplayerid)) {
                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                GetPlayerName(playerid, sendername, sizeof(sendername));

                format(string, sizeof(string),"You have sent a gang invite to %s.", giveplayer);
                SendClientMessage(playerid, COLOR_GREEN, string);
                format(string, sizeof(string),"You have recieved a gang invite from %s to '%s' (id: %d)", sendername, gangNames[playerGang[playerid]],playerGang[playerid]);
                SendClientMessage(giveplayerid, COLOR_GREEN, string);

                gangInvite[giveplayerid]=playerGang[playerid];

            } else
                SendClientMessage(playerid, COLOR_RED, "No such player exists!");

        //Leave Gang//
        } else if (gangcmd==4) {
            PlayerLeaveGang(playerid);
        }

        return 1;
    }

Really appreciated if someone has at least 2 minutes to solve this out for me. As I said, really appreciated! Good luck to everyone.
__________________
I don't care.
••• ĤÁĶÁM ••• is offline  
Old 09/09/2010, 02:53 AM   #9
••• ĤÁĶÁM •••
Huge Clucker
 
••• ĤÁĶÁM •••'s Avatar
 
Join Date: Aug 2010
Location: C:/windows/system32/hakam.dll
Posts: 275
Reputation: 0
Default Re: [ERRORS] Errors appear after adding a Gang System.

Excuse me, everyone. Looking forward for help, really appreciated.
__________________
I don't care.
••• ĤÁĶÁM ••• is offline  
Old 09/09/2010, 03:58 AM   #10
••• ĤÁĶÁM •••
Huge Clucker
 
••• ĤÁĶÁM •••'s Avatar
 
Join Date: Aug 2010
Location: C:/windows/system32/hakam.dll
Posts: 275
Reputation: 0
Default Re: [ERRORS] Errors appear after adding a Gang System.

••• BUMP •••
__________________
I don't care.
••• ĤÁĶÁM ••• is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AFK system errors xir Help Archive 8 27/08/2010 05:26 PM
Fuel system errors lmfaoown Help Archive 4 07/03/2010 06:17 PM
Errors on my Engine System Torran Help Archive 4 24/01/2010 05:22 PM
Common compiling errors - READ BEFORE POSTING ERRORS Streetplaya Help Archive 0 23/01/2010 11:20 AM
Adding BasicAdmin Into My GM, No errors but it still doesent work :S aspire5630 Help Archive 2 19/04/2009 12:41 PM


All times are GMT. The time now is 08:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.