Komande ne rade

Započeo mmlinaric, Jun 25, 2018, 19:01:38 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Sljedeca je situacija:
Radim DM Server, napravion sam dvije komande:
/kill - da se player ubije
/mykills - da player vidi koliko je sveukupno killova napravio na svom acc-u

Kad player napise to server kaze da komande ne postoje:


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid,0);
return 1;
}

if (strcmp("/mykills", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_BLUE,"Total number of kills you made on this account is:");
SendClientMessage(playerid,COLOR_BLUE,PlayerInfo[pKills]);
return 1;
}

return 0;
}


Kad odem na compiler kaze da je sve u redu. Molim vas pomoc!!!!
Poslednja Izmena: Jun 28, 2018, 20:11:55 POSLE PODNE od Bašovski

Probaj

[pawn]public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp(cmdtext, "/kill", true) == 0)
   {
   SetPlayerHealth(playerid,0);
   return 1;
   }
   
   if(strcmp(cmdtext, "/mykills", true) == 0)
   {
   SendClientMessage(playerid,COLOR_BLUE,"Total number of kills you made on this account is:");
   SendClientMessage(playerid,COLOR_BLUE,PlayerInfo[pKills]);
   return 1;
   }
   
   return 0;
}[/pawn]

ZCMD include skini lakse mnogo ..
[pawn]CMD:mykills(playerid ,params[])
{
   SendClientMessage(playerid, COLOR_BLUE, "Total number of kills you made on this account is:");
   SendClientMessage(playerid, COLOR_BLUE, PlayerInfo[pKills];
   return 1;
}[/pawn]
Poslednja Izmena: Jun 26, 2018, 11:56:20 PRE PODNE od pingaz
Moderator: 2018 (( Development ))
Moderator: 2019 (( Forumske igre ))

if(strcmp(cmdtext, "/mykills", true) == 0)
   {
   SendClientMessage(playerid,COLOR_BLUE,"Total number of kills you made on this account is:");
        {
            SendClientMessage(playerid,COLOR_BLUE, PlayerInfo[playerid][pKills]);
        }

   return 1;
   }

[pawn]public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp(cmdtext, "/kill", true) == 0)
   {
   SetPlayerHealth(playerid,0);
   return 1;
   }
   
   if(strcmp(cmdtext, "/mykills", true) == 0)
   {
        new string[256];
        format(string, 256, "Total number of kills you made on this account is: %d", PlayerInfo[pKills]);
   SendClientMessage(playerid,COLOR_BLUE,string);
   return 1;
   }
   
   return 0;
}[/pawn]

ZCMD

[pawn]COMMAND:kill(playerid, params[])
{
   SetPlayerHealth(playerid,0);
   return 1;
}
   
COMMAND:mykills(playerid, params[])
{
        new string[256];
        format(string, 256, "Total number of kills you made on this account is: %d", PlayerInfo[pKills]);
   SendClientMessage(playerid,COLOR_BLUE,string);
   return 1;
}
[/pawn]