Fakechat
#1

Not working... :/

error on console : [02:36:29] sscanf warning: Strings without a length are deprecated, please add a destination size.

pawn Код:
dcmd_fakechat(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new id,text[128];
        if(sscanf(params, "us", id, text)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /fakechat [ID] [TEXT]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF7800FF, "player offline");
        SendPlayerMessageToAll(id,text);
        return 1;
    }
    return 0;
}
Reply
#2

pawn Код:
dcmd_fakechat(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new id,text[128];
        if(sscanf(params, "us[127]", id, text)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /fakechat [ID] [TEXT]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF7800FF, "player offline");
        SendPlayerMessageToAll(id,text);
        return 1;
    }
    return 0;
}
You needed to specify the size of the string for sscanf.
Reply
#3

okay the console error aint coming.. but when i try to fakechat for myself.. it says player offline..
Reply
#4

Why not use OnPlayerText(id,text);
Reply
#5

how would i do that ? /fakechat is a command
Reply
#6

Thanks for working command Calgon, +1 rep
Reply
#7

It aint working but... it doenst fake chat myself.. i havent tested with other people.. but theres no reason why it wouldnt fakechat me
Reply
#8

have u even tried to login to rcon?
Reply
#9

Quote:
Originally Posted by wildcookie007
Посмотреть сообщение
have u even tried to login to rcon?
-.- -.- OBVIOUSLY
Reply
#10

pawn Код:
dcmd_fakechat(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new id,text[128], str[128] , NameOfPlayer[24];
        new color = GetPlayerColor ( playerid );
        if(sscanf(params, "us[127]", id, text)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /fakechat [ID] [TEXT]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF7800FF, "player offline");
        GetPlayerName ( id , NameOfPlayer , 24 );
        format ( str , 128 , "%s: {FFFFFF}%s" , NameOfPlayer , text );
        SendClientMessageToAll ( color , str );
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)