SA-MP Forums Archive
[HELP]Double Messages - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Double Messages (/showthread.php?tid=120004)



[HELP]Double Messages - thecutkiller - 10.01.2010

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.



Re: [HELP]Double Messages - Fiki - 10.01.2010

this is functionaly:

Quote:

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




Re: [HELP]Double Messages - thecutkiller - 10.01.2010

thanks! Now it works!


Re: [HELP]Double Messages - Correlli - 10.01.2010

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;
}



Re: [HELP]Double Messages - thecutkiller - 10.01.2010

yeah, there still were double messages, thanks!


Re: [HELP]Double Messages - thecutkiller - 10.01.2010

even now double messages


Re: [HELP]Double Messages - Fiki - 10.01.2010

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