SCCANF return invalid_player_id every time...
#1

Hey, No matter what command I make SSCANF returns invalid player id

pawn Код:
CMD:heal(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are not a Admin");
    {
        new Healing, string[52];
        if(sscanf(params, "u", Healing)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Usage: /heal [id]");
        else if(Healing == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: User is not connected");
        SetPlayerHealth(Healing, 100);
        new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        GetPlayerName(Healing, tName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "Admin %s has healed you!", pName);
        SendClientMessage(Healing, COLOR_GREEN, string);
        format(string, sizeof(string), "You have healed %s", tName);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "[Admin %s] Has Healed %s", pName, tName);
        SendMessageToAdmins(COLOR_GREEN, string);
    }
    return 1;
}
Reply
#2

actualize your include/plugin
Reply
#3

Try this:

pawn Код:
CMD:heal(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are not a Admin");
    {
        new Healing, string[52];
        if(sscanf(params, "u", Healing)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Usage: /heal [id]");
        else if(!IsPlayerConnected(Healing)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: User is not connected");
        SetPlayerHealth(Healing, 100);
        new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        GetPlayerName(Healing, tName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "Admin %s has healed you!", pName);
        SendClientMessage(Healing, COLOR_GREEN, string);
        format(string, sizeof(string), "You have healed %s", tName);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "[Admin %s] Has Healed %s", pName, tName);
        SendMessageToAdmins(COLOR_GREEN, string);
    }
    return 1;
}
And also try updating sscanf if you have the version 0.3c-R5 of the SA:MP server
Reply
#4

Just update plugin
Reply
#5

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
actualize your include/plugin
I though it was my plugin Yet the one I downloaded and keep downloading 0.3c rc5 sscanf 2 doesnt work.

Quote:
Originally Posted by OPremium
Посмотреть сообщение
Try this:

pawn Код:
CMD:heal(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are not a Admin");
    {
        new Healing, string[52];
        if(sscanf(params, "u", Healing)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Usage: /heal [id]");
        else if(!IsPlayerConnected(Healing)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: User is not connected");
        SetPlayerHealth(Healing, 100);
        new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        GetPlayerName(Healing, tName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "Admin %s has healed you!", pName);
        SendClientMessage(Healing, COLOR_GREEN, string);
        format(string, sizeof(string), "You have healed %s", tName);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "[Admin %s] Has Healed %s", pName, tName);
        SendMessageToAdmins(COLOR_GREEN, string);
    }
    return 1;
}
And also try updating sscanf if you have the version 0.3c-R5 of the SA:MP server
The code above wont change anything

I use this SSCANF http://forum.sa-mp.com/showthread.ph...ghlight=SSCANF

Yet no hope INVALID_PLAYER_ID is still returned
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)