[HELP] please sscanf
#1

Hello till this morning I was know see that problem. So I enter in server and typed /check my id 0 okay and I'm lvl 3 but in that command it says that my level is 0 and also all check in command are on 0 like money in the bank health etc. I have already lastest version of sscanf which is 2.8.1. Thanks
Reply
#2

How about showing us the code.
We are not wizards.
Reply
#3

pawn Код:
CMD:check(playerid,params[])
{
    if(PlayerInfo[playerid][Admin] >= 1 || IsPlayerAdmin(playerid))
    {
        new id,Float:hp,Float:Poz[3],ipz[50];
        if(sscanf(params,"u",id)) return SCM(playerid,COLOR_GRAD3,"{FFAF00}Koristite: {FFFFFF}/check [Player ID or Name]");
        if(!IsPlayerConnected(id)) return SCM(playerid,COLOR_GRAD2,"{F81414}[Greska!] {C3C3C3}Wrong id/name of user!");
        GetPlayerHealth(id,hp);
        GetPlayerIp(id,ipz,50);
        GetPlayerPos(id,Poz[0],Poz[1],Poz[2]);
        SCMF(playerid,COLOR_WHITE,"Health: (%.1f) | Player IP: (%d) | Level: (%d)",hp,ipz,PlayerInfo[id][Level]); all of that here show me 0
        SCMF(playerid,COLOR_WHITE,"Player Position: Xpoz: (%.1f) | Ypoz: (%.1f) | Zpoz: (%.1f)",Poz[0],Poz[1],Poz[2]); also with this is all on 0
    }
    else return SCM(playerid,COLOR_GRAD2,"{FFFFFF}[{F81414}G-Protect{FFFFFF}] {C3C3C3}Only Administrats can use this command!");
    return 1;
}
Here. Thanks
Reply
#4

The only wrong thing i see there is that you try to output the playerip which is a string as a decimal (%d)
pawn Код:
CMD:check(playerid,params[])
{
    if(PlayerInfo[playerid][Admin] >= 1 || IsPlayerAdmin(playerid))
    {
        new id,Float:hp,Float:Poz[3],ipz[50];
        if(sscanf(params,"u",id)) return SCM(playerid,COLOR_GRAD3,"{FFAF00}Koristite: {FFFFFF}/check [Player ID or Name]");
        if(!IsPlayerConnected(id)) return SCM(playerid,COLOR_GRAD2,"{F81414}[Greska!] {C3C3C3}Wrong id/name of user!");
        GetPlayerHealth(id,hp);
        GetPlayerIp(id,ipz,50);
        GetPlayerPos(id,Poz[0],Poz[1],Poz[2]);
        SCMF(playerid,COLOR_WHITE,"Health: (%.1f) | Player IP: (%s) | Level: (%d)",hp,ipz,PlayerInfo[id][Level]); all of that here show me 0
        SCMF(playerid,COLOR_WHITE,"Player Position: Xpoz: (%.1f) | Ypoz: (%.1f) | Zpoz: (%.1f)",Poz[0],Poz[1],Poz[2]); also with this is all on 0
    }
    else return SCM(playerid,COLOR_GRAD2,"{FFFFFF}[{F81414}G-Protect{FFFFFF}] {C3C3C3}Only Administrats can use this command!");
    return 1;
}
Are you sure that your SCMF works properly?
Reply
#5

it work few days ago I don't know what to do also in one command /kill I have

%s you killed by admin %s there is also scmf and when I kill myself or someone it says only you killed by admin luca but it supose to tell luca you killed by admin luca and this for ip it work perfect few days ago I don't know where is the problem or what causing this. thanks and do you maybe want to see scmf
Reply
#6

I'd like to. But why don't you use format with SCM? You have to write 2 lines instead of 1 but at least you'll be sure that you did it the right way.
Reply
#7

I was just thinking about format please wait one minute or two I was know put format and send with smc know I will see is this gona work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)