OnRconCommand
#1

Hey, i have little problem.
pawn Код:
public OnRconCommand(cmd[])
    {
        if( strcmp(cmd,"wmsg",true,strlen("wmsg") )==0 )
        {
            new
                Owner[20],
                Sprava[100],
                command[20],
                str[128]
            ;
            sscanf(cmd,"s[20] s[20] s[100]",command,Owner,Sprava);
            format(str,128,"%s: %s",Owner,Sprava);
            SendClientMessageToAll(biela,str);
        }
        return 1;
    }
and, when i type eg. "/rcon wmsg Mmartin some aweeesome text here", nothing happens. Any idea?
Reply
#2

Quote:
Originally Posted by Magazinez
Посмотреть сообщение
whats the 3rd string for?

s[100]?

EDIT: and i cant see a GetPlayerName function..
He doesn't need one, he is typing his 'own' name.
[strike]
maybe this sounds akward but..
you should use strcmp + >>>STRREST<<<
[/strike]

You should use the sscanf to get the rest of the string, i think you just can leave 's' there?
http://forum.sa-mp.com/showthread.ph...ghlight=sscanf
Reply
#3

Problem solution was on wiki..

Quote:

This callback is called when a player types things into the RCON console. This callback will only work in the gamemode if you have it in a filterscript that gets loaded.

Reply
#4

okay nice, I learned something too xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)