My command wount work...
#1

Hey i made my command that restores player's health i compile and stuff, no errors but ingame it says SERVER:Unknown command :S:S:S Please help, heres the code..

PHP код:
{
    if (
strcmp("/elud"cmdtexttrue10) == 0)
    {
        
SetPlayerHealth(playerid,100);
        
SendClientMessage(playerid,COLOR_GREEN,"Su elud tдitusid");
        return 
1;
    }
    return 
0;

And thats under OnPlayerCommandText
Reply
#2

Anyone?
Reply
#3

pawn Код:
if (strcmp("/elud", cmdtext, true, 10) == 0)
    {
        SetPlayerHealth(playerid,100);
        SendClientMessage(playerid,COLOR_GREEN,"Su elud tдitusid");
        return 1;
    }
And please use [pawn] tags php tags sucks.
Reply
#4

Or try this


PHP код:
if(strcmp(cmd"/elud"true) == 0)
    {
       
SetPlayerHealth(playerid,100); 
              
SendClientMessage(playerid,COLOR_GREEN,"Su elud tдitusid");
        return 
1;
    } 
Reply
#5

The problem is with that "return 0;". I explain it to you: that return is to return a specific value for ex putting 0 it's like saying to the server to send a message to that player that it is an invalid Cmd, otherwise putting 1 it's like saying to the server to process the info that you typed earlier, other people do this "return SendClientMessage..." ex:
Код:
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"You are an Admin"); // if you are admin it will send you a message that will say that you are an admin, if you are not, it will not send anything
So try to change that 0 to 1 or delete that return 0.
Hope it helps!
Reply
#6

Inside the callback OnPlayerCommandText you have to return 0, but inside your command you have to return 1 if you want it to work
Reply
#7

It still doesnt work...
Reply
#8

Nдe proovi kas tццtab zcmd iga

pawn Код:
CMD:elud(playerid, params[])
{
    SetPlayerHealth(playerid,100);
    SendClientMessage(playerid,COLOR_GREEN,"Su elud tдitusid");
    return 1;
}
Reply
#9

Jep, tдnud, got it fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)