What is wrong here in this code
#1

PHP код:
if (strcmp(cmdtext"/events"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
SendClientMessage(playeridCOLOR_GREEN"Events admins Online:");
            for(new 
0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
PlayerInfo[i][pEventadmin] >= 
                    
{
                        new 
sendername[MAX_PLAYER_NAME];
                        
GetPlayerName(isendernamesizeof(sendername));
                        
Message(playeridCOLOR_GREENstring);
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_YELLOW"*** Server Info *** : No events admins ONLINE");
                        }
                    }
                }
            }
            
SendClientMessage(playeridCOLOR_GREEN"______________");
        }
        return 
1;
 } 
Reply
#2

pawn Код:
if (strcmp(cmdtext, "/events", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new count=0;
            SendClientMessage(playerid, COLOR_GREEN, "Events admins Online:");
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][pEventadmin] >= 1)
                    {
                        count++;
                        new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(i, sendername, sizeof(sendername));
                        Message(playerid, COLOR_GREEN, string);
                    }
                }
            }
             if(count==0)
                return SendClientMessage(playerid, COLOR_YELLOW, "*** Server Info *** : No events admins ONLINE");
            SendClientMessage(playerid, COLOR_GREEN, "______________");
        }
        return 1;
 }
Reply
#3

its not only this because pawno is crash
Reply
#4

Edited.
Reply
#5

If you can't see what is wrong, then I seriously doubt me debugging your script is going to help you
pawn Код:
if (strcmp(cmdtext, "/events", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            SendClientMessage(playerid, COLOR_GREEN, "Events admins Online:");
            new
                count,
                string[64]
            ;
            for(new i; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][pEventadmin] >= 1
                    {
                        GetPlayerName(i, string, sizeof(string));
                        format( string , sizeof(string) , "(%d) %s" , i , string );
                        SendClientMessage(playerid, COLOR_GREEN, string);
                        count++;
                    }
                }
            }
            if( !count )
            {
                SendClientMessage(playerid, COLOR_YELLOW, "*** Server Info *** : No events admins ONLINE");
            } else {
                SendClientMessage(playerid, COLOR_GREEN, "______________");
            }
        }
        return 1;
}
basically, the logic, indentation, and number of braces in this piece of code is completely wrong.


good luck
Reply
#6

Quote:
Originally Posted by boyan96
Посмотреть сообщение
its not only this because pawno is crash
https://sampforum.blast.hk/showthread.php?tid=171429
Reply
#7

C:\Users\User\Desktop\ss.pwn(11619) : error 017: undefined symbol "Message"
11619>>>>> Message(playerid, COLOR_GREEN, string);
Reply
#8

pawn Код:
#define Message SendClientMessage
or
pawn Код:
SendClientMessage(playerid, COLOR_GREEN, string);
Reply
#9

its works but didn't show online events admins
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)