Problem(Message sent to everyone)
#1

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 !
Reply
#2

use SendPlayerMessageToPlayer instead of sendclientmessage
Reply
#3

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

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
Reply
#5

Nope,same problem will surely appear O-O
Reply
#6

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
Reply
#7

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)
Reply
#8

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 :/
Reply
#9

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

https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#10

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 ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)