#1

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        return 1;
    }
    dcmd(help,4,cmdtext);
    return 0;
}
pawn Код:
dcmd_help(playerid,params[]) {
    #pragma unused params
    if(IsPlayerConnected(playerid) == 0)
    {
        SendClientMessage(playerid,0x0BF4AEFF,"blablabla");
        SendClientMessage(playerid,0x0BF4AEFF,"blablabla");
        SendClientMessage(playerid,0x0BF4AEFF,"blablabla");
        SendClientMessage(playerid,0x0BF4AEFF,"blablabla");
    }
    return 1;
}
Now for some reason when I go in-game the commands don't work, any ideas...
Reply
#2

You're running FS's on your server codeds on DCMD?
Reply
#3

Quote:

filterscripts adminspec vactions

nope.
Reply
#4

Quote:
Originally Posted by (FF)TeddyBear
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        return 1;
    }
    dcmd(help,4,cmdtext);//this is fine.
    return 0;
}
pawn Код:
dcmd_help(playerid,params[]) {
    #pragma unused params
    if(IsPlayerConnected(playerid) == 0)//tested with this does not work as I thought it would not. if(IsPlayerConnected(playerid)) this did.
    {
        SendClientMessage(playerid,0x0BF4AEFF,"blablabla");
        SendClientMessage(playerid,0x0BF4AEFF,"blablabla");
        SendClientMessage(playerid,0x0BF4AEFF,"blablabla");
        SendClientMessage(playerid,0x0BF4AEFF,"blablabla");
    }
    return 1;
}
I take it this is a help information command that can be used in player select class?. If you only want them to use in game then.

pawn Код:
if (!IsPlayerConnected(playerid))
Anyway try that it worked for me.
Reply
#5

Nope didn't work
Reply
#6

Try it without that line Teddy. Just send the messages. I cannot think what it can be other than don't load any filterscripts then try it and have you got the right dcmd line at the top. If I remember there where two floating around.
Reply
#7

Quote:
Originally Posted by ♦۞pкћп§-шŧųĄ۞♦
Try it without that line Teddy. Just send the messages. I cannot think what it can be other than don't load any filterscripts then try it and have you got the right dcmd line at the top. If I remember there where two floating around.
Yea I removed that line and it works now, thnx :P
Reply
#8

This might have something to do with the includes thinking about it a_players.inc which is included in a_samp. If you still wanna use that line check you have all the includes.
Reply
#9

pawn Код:
if(IsPlayerConnected(playerid) == 0)
What your doing there is checking if the player is not connected. This code will never ever execute.
pawn Код:
if(IsPlayerConnected(playerid) == 1)
is the right code.
Reply
#10

Now I never used it like that but it makes sense .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)