ID Bug
#1

Hey guys.

When i use /adcia [id] like /adcia 1, it says
The player ID 84 is not connected to the server. You cannot give them CIA status.
What's going on ? i used /adcia 1 not /adcia 84, what's wrong with that?

Here is the command code.

PHP код:
dcmd_adcia(playerid,params[])
{
    new 
string[128];
    new 
ID;
    if(
sscanf(params,"ui",ID))
    {
        
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adcia (Player Name/ID)");
        return 
1;
    }
    if(!
IsPlayerConnected(ID))
    {
        
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot give them CIA status.",ID);
        
SendClientMessage(playerid,COLOR_ERROR,string);
        return 
1;
    }
    if(
PLAYERLIST_authed[ID] != 1)
    {
        
format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you give them CIA status.",PlayerName(ID),ID);
        
SendClientMessage(playerid,COLOR_ERROR,string);
        return 
1;
    }
    if(
CanUseCIA[ID] == 1337)
    {
        
format(string,sizeof(string),"%s(%d) is already a CIA member.",PlayerName(ID),ID);
        
SendClientMessage(playerid,COLOR_ERROR,string);
        return 
1;
    }
    
format(string,sizeof(string),"[ADMIN CIA] Administrator has given %s(%d) CIA status.",PlayerName(ID),ID);
    
SendClientMessageToAll(COLOR_ADMIN,string);
    
SendClientMessage(ID,COLOR_ADMIN,"You have been given CIA status by a Server Administrator. Congratulations.");
    
CanUseCIA[ID] =1337;
    
format(string,sizeof(string),"9[ADMIN CIA] Administrator has given %s(%d) CIA status.",PlayerName(ID),ID);
    
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    return 
1;

Reply
#2

In sscanf "ui" change it to "u"
pawn Код:
dcmd_adcia(playerid,params[])
{
    new string[128];
    new ID;
    if(sscanf(params,"u",ID))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adcia (Player Name/ID)");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot give them CIA status.",ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(PLAYERLIST_authed[ID] != 1)
    {
        format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you give them CIA status.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(CanUseCIA[ID] == 1337)
    {
        format(string,sizeof(string),"%s(%d) is already a CIA member.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    format(string,sizeof(string),"[ADMIN CIA] Administrator has given %s(%d) CIA status.",PlayerName(ID),ID);
    SendClientMessageToAll(COLOR_ADMIN,string);

    SendClientMessage(ID,COLOR_ADMIN,"You have been given CIA status by a Server Administrator. Congratulations.");
    CanUseCIA[ID] =1337;

    format(string,sizeof(string),"9[ADMIN CIA] Administrator has given %s(%d) CIA status.",PlayerName(ID),ID);
    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    return 1;
}
Reply
#3

Quote:
Originally Posted by Tayab
Посмотреть сообщение
In sscanf "ui" change it to "u"
pawn Код:
dcmd_adcia(playerid,params[])
{
    new string[128];
    new ID;
    if(sscanf(params,"u",ID))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adcia (Player Name/ID)");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot give them CIA status.",ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(PLAYERLIST_authed[ID] != 1)
    {
        format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you give them CIA status.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(CanUseCIA[ID] == 1337)
    {
        format(string,sizeof(string),"%s(%d) is already a CIA member.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    format(string,sizeof(string),"[ADMIN CIA] Administrator has given %s(%d) CIA status.",PlayerName(ID),ID);
    SendClientMessageToAll(COLOR_ADMIN,string);

    SendClientMessage(ID,COLOR_ADMIN,"You have been given CIA status by a Server Administrator. Congratulations.");
    CanUseCIA[ID] =1337;

    format(string,sizeof(string),"9[ADMIN CIA] Administrator has given %s(%d) CIA status.",PlayerName(ID),ID);
    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    return 1;
}
I got that message............
The player ID 65535 is not connected to the server. you cannot give them CIA status.
Reply
#4

pawn Код:
dcmd_adcia(playerid,params[])
{
    printf("adcia: %s", params);
    new ID, string[128];
    if(sscanf(params,"u",ID)) return SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adcia (Player Name/ID)");
    if(!IsPlayerConnected(ID) || ID == INVALID_PLAYER_ID)
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot give them CIA status.", ID);
        return SendClientMessage(playerid,COLOR_ERROR,string);
    }
    if(PLAYERLIST_authed[ID] != 1)
    {
        format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you give them CIA status.",PlayerName(ID),ID);
        return SendClientMessage(playerid,COLOR_ERROR,string);
    }
    if(CanUseCIA[ID] == 1337)
    {
        format(string,sizeof(string),"%s(%d) is already a CIA member.",PlayerName(ID),ID);
        return SendClientMessage(playerid,COLOR_ERROR,string);
    }
    format(string,sizeof(string),"[ADMIN CIA] Administrator has given %s(%d) CIA status.",PlayerName(ID),ID); SendClientMessageToAll(COLOR_ADMIN,string);
    SendClientMessage(ID,COLOR_ADMIN,"You have been given CIA status by a Server Administrator. Congratulations.");
    CanUseCIA[ID] =1337;

    format(string,sizeof(string),"9[ADMIN CIA] Administrator has given %s(%d) CIA status.",PlayerName(ID),ID); IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    return 1;
}
Try it, And if it didn't work tell me what was printed on the console
Reply
#5

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
pawn Код:
dcmd_adcia(playerid,params[])
{
    printf("adcia: %s", params);
    new ID, string[128];
    if(sscanf(params,"u",ID)) return SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adcia (Player Name/ID)");
    if(!IsPlayerConnected(ID) || ID == INVALID_PLAYER_ID)
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot give them CIA status.", ID);
        return SendClientMessage(playerid,COLOR_ERROR,string);
    }
    if(PLAYERLIST_authed[ID] != 1)
    {
        format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you give them CIA status.",PlayerName(ID),ID);
        return SendClientMessage(playerid,COLOR_ERROR,string);
    }
    if(CanUseCIA[ID] == 1337)
    {
        format(string,sizeof(string),"%s(%d) is already a CIA member.",PlayerName(ID),ID);
        return SendClientMessage(playerid,COLOR_ERROR,string);
    }
    format(string,sizeof(string),"[ADMIN CIA] Administrator has given %s(%d) CIA status.",PlayerName(ID),ID); SendClientMessageToAll(COLOR_ADMIN,string);
    SendClientMessage(ID,COLOR_ADMIN,"You have been given CIA status by a Server Administrator. Congratulations.");
    CanUseCIA[ID] =1337;

    format(string,sizeof(string),"9[ADMIN CIA] Administrator has given %s(%d) CIA status.",PlayerName(ID),ID); IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    return 1;
}
Try it, And if it didn't work tell me what was printed on the console
I got that message in the console.
Код HTML:
[21:33:49] adcia: 
[21:33:49] sscanf error: System not initialised.
[21:33:51] adcia: 0
[21:33:51] sscanf error: System not initialised.
Reply
#6

Quote:
Originally Posted by ******
Посмотреть сообщение
sscanf error: System not initialised.
If you get this error, you need to make sure that you have recompiled ALL your scripts using the LATEST version of "sscanf2.inc". Older versions didn't really require this as they only had two natives - "sscanf" and "unformat", the new version has some other functions - you don't need to worry about them, but you must use "sscanf2.inc" so that they are correctly called. If you think you have done this and STILL get the error then try again - make sure you are using the correct version of PAWNO for example.
Original post by ****** , also take a look at the sscanf plugin your problem on sscanf plugin or include https://sampforum.blast.hk/showthread.php?tid=120356
Reply
#7

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
Original post by ****** , also take a look at the sscanf plugin your problem on sscanf plugin or include https://sampforum.blast.hk/showthread.php?tid=120356
Fixed Thanks, i had to update my sscanf inc and plugins.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)