OnPlayerStreamIn/Out weard error
#1

Hello,
I made a 'script' for 'OnPlayerStreamIn/out'
here is the code:
Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
    PlayerPlaySound(playerid, 1083, 0.0, 0.0, 10.0);
    new PlayerName[MAX_PLAYER_NAME],
    string[128];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "[STREAM-IN]{FFFFFF} %s.", PlayerName);
    SendClientMessageToAll(COLOR_ORANGE, string);
    return 1;
}
//----------------------------------------------------------
public OnPlayerStreamOut(playerid, forplayerid)
{
    PlayerPlaySound(playerid, 1084, 0.0, 0.0, 10.0);
    new PlayerName[MAX_PLAYER_NAME],
    string[128];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "[STREAM-OUT]{FFFFFF} %s.", PlayerName);
    SendClientMessageToAll(COLOR_ORANGE, string);
    return 1;
}
The weard thing is, if there is a NPC by me, it plays the sound. And alll the other time, it will send just random the message's. Even if their is no npc at all. I don't now whats wrong, i don't now how to fix it. I hope you can help me.
Sorry for my bad english. MathijsS
Reply
#2

I didn't understand so much, what do you need to make.
But as I saw to check if there is NPC
pawn Код:
// public OnPlayerStream In/Out (playerid, forplayerid)
{
    if (IsPlayerNPC(playerid))
    {
        // Code Here
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
I didn't understand so much, what do you need to make.
But as I saw to check if there is NPC
pawn Код:
// public OnPlayerStream In/Out (playerid, forplayerid)
{
    if (IsPlayerNPC(playerid))
    {
        // Code Here
    }
    return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerStreamIn
It will send me a message when a player will be streamt by me. That's when a player is in my district. Butt it does'nt work... Why?
Reply
#4

if a player streams in/out, the text gets sent to all players...
Код:
SendClientMessageToAll(COLOR_ORANGE, string);
...which will spam the chat with just a few players, try:
Код:
SendClientMessage(playerid,COLOR_ORANGE, string);
..to send the stream-text to 1 playerid.
Reply
#5

Quote:
Originally Posted by Babul
Посмотреть сообщение
if a player streams in/out, the text gets sent to all players...
Код:
SendClientMessageToAll(COLOR_ORANGE, string);
...which will spam the chat with just a few players, try:
Код:
SendClientMessage(playerid,COLOR_ORANGE, string);
..to send the stream-text to 1 playerid.
well, what you sayt works. Now i have another problem. He shows only my name. Not the name of the other player. Can you fix that?
Reply
#6

Can anyone help me?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)