[HELP]Double Messages
#1

Hello.

When someone joins, kills or leaves you see that message 2 times.

When I compile the gamemode I have 1 warning
Код:
myfirstdeathmatch4.pwn(792) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
(I removed the futher adress, thats personal.)

And now the piece of code that the warning is about:

Код:
public OnPlayerCommandText(playerid, cmdtext[])

	if (strcmp(cmdtext, "/kill",true) == 0)
{
		SetPlayerHealth(playerid, 0);

    return 1;
}
What is wrong with this?

Thanks, Jaap Koopman.
Reply
#2

this is functionaly:

Quote:

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

Reply
#3

thanks! Now it works!
Reply
#4

Quote:
Originally Posted by Fiki
this is functionaly:

Quote:

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

No, it should be like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/kill", true) == 0)
  {
    SetPlayerHealth(playerid, 0);
    return 1;
  }
  return 0;
}
Reply
#5

yeah, there still were double messages, thanks!
Reply
#6

even now double messages
Reply
#7

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Fiki
this is functionaly:

Quote:

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

No, it should be like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/kill", true) == 0)
  {
    SetPlayerHealth(playerid, 0);
    return 1;
  }
  return 0;
}
oppps, yeah this is good i write wrong return
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)