Small Question
#1

May i ask a question?

i did

pawn Код:
public OnPlayerConnect(playerid)
{
    PlayerPlaySound(playerid, 1183, 0, 0, 0);
    //etc......
}
now when the player spawn , the player still can hear the sound.

how to stop it? i searched alot for a function that stops sounds but failed.

Any help?

Thanks;
Reply
#2

Post your OnPlayerSpawn
Reply
#3

pawn Код:
public OnPlayerSpawn(playerid)
{
    bkstatus[playerid] = 0;
    if(GetPlayerTeam(playerid) == Team_Cops)
    {
        new Random = random(sizeof(randomspawncop));
        SetPlayerPos(playerid, randomspawncop[Random][0], randomspawncop[Random][1], randomspawncop[Random][2]);
        SetPlayerFacingAngle(playerid, randomspawncop[Random][3]);
        SetPlayerColor(playerid, Color_Blue);
        new pname[MAX_PLAYERS], spawnmsg[100];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(spawnmsg, sizeof(spawnmsg), "MSG: Player %s [%d] spawned as a COP", pname, playerid);
        SendClientMessageToAll(Color_Blue, spawnmsg);
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "MESSAGE..", "{FFFFFF}Welcome,\n you have spawned as a {0008FF}COP{FFFFFF}\nRules:\n1)Don't teamkill\n2)Don't use 3rd party programs aka Hacks\n3)Don't Hack because it leads to {EE0000}Ban{FFFFFF}\n4)Don't Spam in chat.\n5)Your team is {0008FF}COP {FFFFFF} so kill other {EE0000}TERRORISTS{FFFFFF}! \n6)More rules on "SITE"", "OK", "");
    }
    else if(GetPlayerTeam(playerid) == Team_Terrorists)
    {
        new Random = random(sizeof(randomspawnterr));
        SetPlayerPos(playerid, randomspawnterr[Random][0], randomspawnterr[Random][1], randomspawnterr[Random][2]);
        SetPlayerFacingAngle(playerid, randomspawnterr[Random][3]);
        SetPlayerColor(playerid, Color_Red);
        new pname[MAX_PLAYERS], spawnmsg[100];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(spawnmsg, sizeof(spawnmsg), "MSG: Player %s [%d] spawned as a TERRORIST", pname, playerid);
        SendClientMessageToAll(Color_Red, spawnmsg);
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "MESSAGE..", "{FFFFFF}Welcome,\n you have spawned as a {EE0000}TERRORIST{FFFFFF}\nRules:\n1)Don't teamkill\n2)Don't use 3rd party programs aka Hacks\n3)Don't Hack because it leads to {EE0000}Ban{FFFFFF}\n4)Don't Spam in chat.\n5)Your team is {EE0000}TERRORIST {FFFFFF}so don't kill other {0008FF}TERRORIST{FFFFFF}! \n6)More rules on "SITE"", "OK", "");
    }
    GivePlayerWeapon(playerid, WEP_Knife, 1); //Knife
    GivePlayerWeapon(playerid, WEP_Vibrator, 1); //Vibrator
    GivePlayerWeapon(playerid, WEP_Sniper, 20); //Sniper
    GivePlayerWeapon(playerid, WEP_Tear_Gas, 15); //Tear Gas
    GivePlayerWeapon(playerid, WEP_Silenced_9mm, 50); //Silenced 9mm
    GivePlayerWeapon(playerid, WEP_M4, 200); //M4
    SetPlayerArmour(playerid, 100);
    TextDrawShowForPlayer(playerid, text1);
    //TextDrawShowForPlayer(playerid, text2);
    TextDrawShowForPlayer(playerid, text4);
    TextDrawShowForPlayer(playerid, text5);
    return 1;
}
Reply
#4

put an invalid sound id it will stop the sound

pawn Код:
PlayerPlaySound(playerid, 1184, 0, 0, 0);
add that onplayerspawn
Reply
#5

Quote:
Originally Posted by Romel
Посмотреть сообщение
put an invalid sound id it will stop the sound

pawn Код:
PlayerPlaySound(playerid, 1184, 0, 0, 0);
add that onplayerspawn
Thanks so much man it works. i also tried
pawn Код:
PlayerPlaySound(playerid, 0, 0, 0, 0);
and it didn't work xD

anyway thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)