Errors i dont know how to fix
#1

hey,
ive get much errors if i change 1 thing

Код:
	if(strcmp(cmd, "/invite", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /invite [playerid/PartOfName]");
				return 1;
			}
			new ftext[20];
			giveplayerid = ReturnUser(tmp);
			if(PlayerInfo[playerid][pLeader] >= 1)
			{
// this i add 
				else if(PlayerInfo[playerid][pMember] >= 1)
				{
// to this
			    	if(IsPlayerConnected(giveplayerid))
			    	{
			        	if(giveplayerid != INVALID_PLAYER_ID)
			        	{
			            	if(PlayerInfo[giveplayerid][pMember] == 0 && PlayerInfo[giveplayerid][pLeader] == 0 && PlayerInfo[giveplayerid][pFMember] == 255 && PlayerInfo[giveplayerid][pFactionBanned] == 0)
					    	{
					        GetPlayerName(playerid, sendername, sizeof(sendername));
					        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					        if(PlayerInfo[playerid][pLeader] == 1) { ftext = "Police Force"; }
					        else if(PlayerInfo[playerid][pLeader] == 2) { ftext = "FBI"; }

					        else if(PlayerInfo[playerid][pLeader] == 3) { ftext = "SASD"; }
					        else if(PlayerInfo[playerid][pLeader] == 4) { ftext = "Firemen/Ambulance"; }
					        else if(PlayerInfo[playerid][pLeader] == 5) { ftext = "National Guards"; }
					        else if(PlayerInfo[playerid][pLeader] == 6) { ftext = "President"; }
					        else if(PlayerInfo[playerid][pLeader] == 7) { ftext = "CIA"; }
					        else if(PlayerInfo[playerid][pLeader] == 8) { ftext = "Hitman Agency"; }
					        else if(PlayerInfo[playerid][pLeader] == 9) { ftext = "News Agency"; }
					        else if(PlayerInfo[playerid][pLeader] == 10) { ftext = "Taxi Cab Company"; }
					        else if(PlayerInfo[playerid][pLeader] == 12) { ftext = "Bounty Hunter"; }
					        format(string, sizeof(string), "* You have Invited %s to join the %s.", giveplayer, ftext);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "* %s has invited you to join the %s, (type /accept faction) to accept.",sendername, ftext);
					        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
							FactionOffer[giveplayerid] = playerid;
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "   That player is already in a Faction / Family, or is faction banned !");
						    return 1;
						}
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command (leaders only) !");
			}
		}
		return 1;
	}
why i get this errors with only that change there ?

Код:
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(2123) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(2128) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(2831) : error 004: function "FixHour" is not implemented
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(5404) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(5418) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(5649) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(5664) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(7438) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(7762) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(7775) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(9749) : error 017: undefined symbol "sscanf"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(11072) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(12229) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(13412) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(13419) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(14031) : error 017: undefined symbol "ProxDetector"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(15851) : error 004: function "FixHour" is not implemented
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(16121) : warning 217: loose indentation
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(16182) : warning 217: loose indentation
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(17089) : error 004: function "FixHour" is not implemented
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(17152) : error 004: function "FixHour" is not implemented
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(18717) : error 017: undefined symbol "dcmd_oprison"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(18717) : error 079: inconsistent return types (array & non-array)
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(18719) : error 017: undefined symbol "dcmd_unban"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(18719) : error 079: inconsistent return types (array & non-array)
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(18720) : error 017: undefined symbol "dcmd_banaccount"
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(18720) : error 079: inconsistent return types (array & non-array)
C:\Users\Dennis\Downloads\server\gamemodes\matrix2.pwn(18721) : error 017: undefined symbol "dcmd_setaccent"
Can someone help me ?
Reply
#2

Ehm you have 2 times
pawn Код:
if(PlayerInfo[playerid][pLeader] >= 1)
What did you exactly change?
Reply
#3

ive added

Код:
				else if(PlayerInfo[playerid][pMember] >= 1)
				{
Reply
#4

Give this a try, I made it a bit shorter, should be easier to add stuff now.
pawn Код:
if(!strcmp(cmd, "/invite", true))
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /invite [playerid/PartOfName]");

            giveplayerid = ReturnUser(tmp);
            if(PlayerInfo[playerid][pLeader] < 1 || PlayerInfo[playerid][pMember] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command (leaders only) !");
            if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "   This player is not connected!");
            if(PlayerInfo[giveplayerid][pMember] == 0 && PlayerInfo[giveplayerid][pLeader] == 0 && PlayerInfo[giveplayerid][pFMember] == 255 && PlayerInfo[giveplayerid][pFactionBanned] == 0)
            {
                new ftext[20];
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                switch(PlayerInfo[playerid][pLeader])
                {
                    case 1: ftext = "Police Force";
                    case 2: ftext = "FBI";
                    case 3: ftext = "SASD";
                    case 4: ftext = "Firemen/Ambulance";
                    case 5: ftext = "National Guards";
                    case 6: ftext = "President";
                    case 7: ftext = "CIA";
                    case 8: ftext = "Hitman Agency";
                    case 9: ftext = "News Agency";
                    case 10: ftext = "Taxi Cab Company";
                    case 12: ftext = "Bounty Hunter";
                }
                format(string, sizeof(string), "* You have Invited %s to join the %s.", giveplayer, ftext);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), "* %s has invited you to join the %s, (type /accept faction) to accept.",sendername, ftext);
                SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                FactionOffer[giveplayerid] = playerid;
            }
            else return SendClientMessage(playerid, COLOR_GREY, "That player is already in a Faction / Family, or is faction banned !");
        }
        return 1;
    }
Reply
#5

Quote:
Originally Posted by PotH3Ad
Посмотреть сообщение
Give this a try, I made it a bit shorter, should be easier to add stuff now.
pawn Код:
if(!strcmp(cmd, "/invite", true))
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /invite [playerid/PartOfName]");

            giveplayerid = ReturnUser(tmp);
            if(PlayerInfo[playerid][pLeader] < 1 || PlayerInfo[playerid][pMember] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command (leaders only) !");
            if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "   This player is not connected!");
            if(PlayerInfo[giveplayerid][pMember] == 0 && PlayerInfo[giveplayerid][pLeader] == 0 && PlayerInfo[giveplayerid][pFMember] == 255 && PlayerInfo[giveplayerid][pFactionBanned] == 0)
            {
                new ftext[20];
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                switch(PlayerInfo[playerid][pLeader])
                {
                    case 1: ftext = "Police Force";
                    case 2: ftext = "FBI";
                    case 3: ftext = "SASD";
                    case 4: ftext = "Firemen/Ambulance";
                    case 5: ftext = "National Guards";
                    case 6: ftext = "President";
                    case 7: ftext = "CIA";
                    case 8: ftext = "Hitman Agency";
                    case 9: ftext = "News Agency";
                    case 10: ftext = "Taxi Cab Company";
                    case 12: ftext = "Bounty Hunter";
                }
                format(string, sizeof(string), "* You have Invited %s to join the %s.", giveplayer, ftext);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), "* %s has invited you to join the %s, (type /accept faction) to accept.",sendername, ftext);
                SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                FactionOffer[giveplayerid] = playerid;
            }
            else return SendClientMessage(playerid, COLOR_GREY, "That player is already in a Faction / Family, or is faction banned !");
        }
        return 1;
    }
Thanks it worked

but one qeustion

if(PlayerInfo[playerid][pLeader] < 1 || PlayerInfo[playerid][pMember] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command (leaders only) !");

does < 1 mean if you are higer then leader 1 ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)