undefined symbol sendername
#1

pawn Код:
if (strcmp("/admins", cmdtext, true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            SendClientMessage(playerid, COLOR_PINK, ".::[ Name of script isnt to be mentioned ]::.");
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][pAdminLevel] >= 1 && PlayerInfo[i][pAdminLevel] <= 11
                    {
                        new printtext[64];
                        {
                            if(PlayerInfo[i][pAdminLevel] == 11) { printtext = "Owner / Scripter"; }
                            else if(PlayerInfo[i][pAdminLevel] == 10) { printtext = "Co Owner"; }
                            else if(PlayerInfo[i][pAdminLevel] == 9) { printtext = "Senior Administrator"; }
                            else if(PlayerInfo[i][pAdminLevel] == 7) { printtext = "Main Administrator"; }
                            else if(PlayerInfo[i][pAdminLevel] == 6) { printtext = "Administrator"; }
                            else if(PlayerInfo[i][pAdminLevel] == 5) { printtext = "Trail Administrator"; }
                            else if(PlayerInfo[i][pAdminLevel] == 4) { printtext = "Senior Moderator"; }
                            else if(PlayerInfo[i][pAdminLevel] == 3) { printtext = "Moderator"; }
                            else if(PlayerInfo[i][pAdminLevel] == 2) { printtext = "Trail Moderator"; }
                            else if(PlayerInfo[i][pAdminLevel] == 1) { printtext = "Suspended Admin"; }
                            else { printtext = "Unknown Rank"; }
                        }
                            GetPlayerName(i, sendername, sizeof(sendername));
                        {
                            format(string, sizeof(string), "%s - %s", printtext, sendername);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        }
                    }
                }
            }
        }
        return 1;
    }
I know this is somthing stupid to get stuck on but im stuck heres my errors


pawn Код:
(471) : error 029: invalid expression, assumed zero
(486) : warning 217: loose indentation
(486) : error 017: undefined symbol "sendername"
(486) : error 017: undefined symbol "sendername"
(486) : error 029: invalid expression, assumed zero
(486) : fatal error 107: too many error messages on one line
im not saying the script name as im making a grand relase
Reply
#2

Put
pawn Код:
new sendername[ MAX_PLAYER_NAME ];
Above
pawn Код:
GetPlayerName(i, sendername, sizeof(sendername));
Reply
#3

pawn Код:
new sendername[MAX_PLAYER_NAME];
Var global
Reply
#4

I'd just add this stock

Код:
stock Name(playerid)
{
	new string[72];
	GetPlayerName(playerid, string, sizeof(string));
	return string;
}
then itstead of doing sendername, put Name(i);
Reply
#5

lol thanks i forgot to define it been a long time since i scripted last using all old methods then once server is done im going to update it all or try thats my plan anyway

also PrawC or somthing i dont want to do that becuse i have lines more than that with that deinition and loads of things with sendername2 and i dont want to mess it up thanks anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)