SA-MP Forums Archive
Problem(Message sent to everyone) - 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: Problem(Message sent to everyone) (/showthread.php?tid=85914)



Problem(Message sent to everyone) - FreeSoul - 10.07.2009

Quote:

public dmventercartimer(playerid)
{
TakingLesson[playerid] = 0;
SendClientMessage(playerid,COLOR_LIGHTRED,"You failed the test.You didn't enter the car !");
RemovePlayerFromVehicle(playerid);
}

Appearently,the message is sent to all players online on the server,not only to the player.It happens to all public things I use,anybody knows a solution? Thanks !


Re: Problem(Message sent to everyone) - Joruz_Tellino - 10.07.2009

use SendPlayerMessageToPlayer instead of sendclientmessage


Re: Problem(Message sent to everyone) - FreeSoul - 10.07.2009

As far as I know that function send the message from a player to another player


Re: Problem(Message sent to everyone) - Joruz_Tellino - 10.07.2009

Quote:
Originally Posted by FreeSoul
As far as I know that function send the message from a player to another player
hmm..

Maybe use GameTextForPlayer
https://sampwiki.blast.hk/wiki/GameTextForPlayer


Re: Problem(Message sent to everyone) - FreeSoul - 10.07.2009

Nope,same problem will surely appear O-O


Re: Problem(Message sent to everyone) - Joruz_Tellino - 10.07.2009

Quote:
Originally Posted by FreeSoul
Nope,same problem will surely appear O-O
Wow Thats weird!
hmmm... Look at your script if you dont have anything set so all players will see clientmessages


Re: Problem(Message sent to everyone) - BMUK - 10.07.2009

SendClientMessage(playerid,COLOR_LIGHTRED,"You failed the test.You didn't enter the car !");

That ^ alone wont send it to everyone. Check your dmventercartimer(playerid) function for a loop! (or post it here)


Re: Problem(Message sent to everyone) - FreeSoul - 10.07.2009

Quote:
Originally Posted by BMUK
SendClientMessage(playerid,COLOR_LIGHTRED,"You failed the test.You didn't enter the car !");

That ^ alone wont send it to everyone. Check your dmventercartimer(playerid) function for a loop! (or post it here)
Quote:

forward dmventercartimer(playerid);

Quote:

public dmventercartimer(playerid)
{
TakingLesson[playerid] = 0;
SendClientMessage(playerid,COLOR_LIGHTRED,"Ai picat testul.Nu ai intrat in masina ca sa dai traseul !");
RemovePlayerFromVehicle(playerid);
}

And this is at the /exit command at OnPlayerCommandText
Quote:

else if(TakingLesson[playerid] == 1)
{
GameTextForPlayer(playerid, "~w~Los Santos ~n~~w~Pershing Square", 1000, 1);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1397.0741,-1571.8979,14.2681);
SendClientMessage(playerid,COLOR_LIGHTRED," You have 20 seconds to enter the car and take the test !");
dmvtimer1 = SetTimer("dmventercartimer",20000,false);
}

The problem happens with all public functions I use with SendClientMessage,and IDk why :/


Re: Problem(Message sent to everyone) - dice7 - 10.07.2009

You need to use SetTimerEx so every playerid will have its own timer

https://sampwiki.blast.hk/wiki/SetTimerEx


Re: Problem(Message sent to everyone) - FreeSoul - 10.07.2009

Quote:
Originally Posted by dice7
You need to use SetTimerEx so every playerid will have its own timer

https://sampwiki.blast.hk/wiki/SetTimerEx
Worked,but can you please explain me the things from SetTimerEx "i","d" etc ?