/makeleader
#1

Hey guys im looking in a tutorial to create factions and i got a problem cna u help me please?

Код HTML:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2541) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2544) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2546) : error 047: array sizes do not match, or destination array is too small
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2553) : error 017: undefined symbol "RemoveName"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2555) : error 017: undefined symbol "RemoveName"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
PHP код:
CMD:makeleader(playeridparams[])
    {
        if(
PlayerInfo[playerid][pAdmin] > 6)
        {
            if(!
sscanf(params"di"params[0], params[1]))
            {
                new 
ftext[30];
                if(
params[1] < || params[1] > MAX_FACTIONS)         return SendClientMessage(playeridCOLOR_GREEN"{48CFD7}» {FFFFFF}ID Faction incorrect.");
                if(!
IsPlayerConnected(params[0]))                   return SendClientMessage(playeridCOLOR_GREEN"{48CFD7}» {FFFFFF}Played offline.");
                switch(
params[1])
                {
                    case 
0:     {PlayerInfo[params[0]][pFaction] = 0ftext "Remove Leader Status"; }
                    case 
1:     {PlayerInfo[params[0]][pFaction] = 6ftext "San Andreas Police Department"; }
                    case 
2:     {PlayerInfo[params[0]][pFaction] = 6ftext "Federal Bureau of Investigation"; }
                    case 
3:     {PlayerInfo[params[0]][pFaction] = 6ftext "National Guards"; }
                    case 
4:     {PlayerInfo[params[0]][pFaction] = 6ftext "San Andreas Government"; }
                    case 
5:     {PlayerInfo[params[0]][pFaction] = 6ftext "San Andreas Medical & Fire Department"; }
                    case 
6:     {PlayerInfo[params[0]][pFaction] = 6ftext "San Andreas News"; }
                    case 
7:     {PlayerInfo[params[0]][pFaction] = 6ftext "San Andreas Medical & Fire Department"; }
                    case 
8:     {PlayerInfo[params[0]][pFaction] = 6ftext "San Andreas Taxi Company"; }
                    case 
9:     {PlayerInfo[params[0]][pFaction] = 6ftext "Hitmen Agency"; }
                }
                new 
string[128];
                
PlayerInfo[params[0]][pLeader] = params[1];
                
PlayerInfo[params[0]][pMember] = params[1];
                
format(stringsizeof(string), "{48CFD7}»{FFFFFF} %s you assigned the faction leader %s."RemoveName(playerid), ftext);
                
SendClientMessage(params[0], 0x6ADFFFFFstring);
                
format(stringsizeof(string), "{48CFD7}»{FFFFFF} %s assigned leader of the faction %s a %s."RemoveName(playerid), ftextRemoveName(params[0]));
                
ABroadCast(COLOR_REDstring3);
            }
            else 
SendClientMessage(playeridCOLOR_WHITE"{48CFD7}» {FFFFFF}Use: /makeleader [player] [faction]");
        }
        else 
SendClientMessage(playeridCOLOR_CORRECTION"You're not autorized");
        return 
1;
    } 
Reply
#2

You got errors here because you copied the system without defining what's "RemoveName(playerid)"..

PHP код:
format(stringsizeof(string), "{48CFD7}»{FFFFFF} %s you assigned the faction leader %s."RemoveName(playerid), ftext);
                
SendClientMessage(params[0], 0x6ADFFFFFstring);
                
format(stringsizeof(string), "{48CFD7}»{FFFFFF} %s assigned leader of the faction %s a %s."RemoveName(playerid), ftextRemoveName(params[0])); 
And you'll have errors with the "ftext" thingy because you can't just use it like that
PHP код:
ftext string
Don't equalize to strings, but use strcpy for example..
Reply
#3

i solve the 1 problem but now i dont know how to do with the removename(playerid)

Код HTML:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2553) : error 017: undefined symbol "RemoveName"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2555) : error 017: undefined symbol "RemoveName"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#4

Told you already.. You didn't define something called "RemoveName" because you copied the script from another gamemode and didn't copy "RemoveName" function as well..
Reply
#5

That's the thing in the other game mode is not removename funtion but i dont know how to adpt it to my funtion, can u give me any idea to try?
Reply
#6

Re-create it yourself with your gamemode functions depending on how its created in the other gamemode..
Reply
#7

what can i do here?

PHP код:
}
                new 
string[128];
                
PlayerInfo[params[0]][pLeader] = params[1];
                
PlayerInfo[params[0]][pMember] = params[1];
                
format(stringsizeof(string), "*You have been promoted to Leader of your requested Faction %s by Admin %s"ftextGetName(params[0]));
                
SendClientMessage(params[0], string);
                
format(stringsizeof(string), "You have given %s control to run Faction %s"GetName(params[0]), ftext);
                
ABroadCast(COLOR_SUCCESSstring3);
            }
            else 
SendClientMessage(playeridCOLOR_WHITE"USAGE: /makeleader [PlayerID / PartOfName] [FactionID]");
        }
        else 
SendClientMessage(playeridCOLOR_CORRECTION"You are not authorized to use this command !");
        return 
1;
    } 
Код:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2554) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

what's the error line?
Reply
#9

PHP код:
SendClientMessage(params[0], string); 
playerid, color, message

PHP код:
SendClientMessage(params[0], 0xFFFFAAAAstring); 
Reply
#10

Quote:
Originally Posted by jlalt
Посмотреть сообщение
PHP код:
SendClientMessage(params[0], string); 
playerid, color, message

PHP код:
SendClientMessage(params[0], 0xFFFFAAAAstring); 
cant i delete this "0xFFFFAAAA" ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)