SA-MP Forums Archive
/makeleader - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /makeleader (/showthread.php?tid=656297)



/makeleader - Jaua10 - 12.07.2018

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;
    } 



Re: /makeleader - JasonRiggs - 12.07.2018

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..


Re: /makeleader - Jaua10 - 12.07.2018

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.



Re: /makeleader - JasonRiggs - 12.07.2018

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..


Re: /makeleader - Jaua10 - 12.07.2018

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?


Re: /makeleader - JasonRiggs - 12.07.2018

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


Re: /makeleader - Jaua10 - 12.07.2018

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.



Re: /makeleader - Florin48 - 12.07.2018

what's the error line?


Re: /makeleader - jlalt - 12.07.2018

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

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



Re: /makeleader - Jaua10 - 12.07.2018

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

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