Jump to content

[REZOLVAT] Ajutor SA:MP Voice


AleXw0w
 Share

Recommended Posts

Salut, as vrea sa primesc si eu ajutor de la un membru de pe acest forum sa ma ajute pentru a pune SA:MP Voice pe gamemode burned, am incercat sa-l pun si imi da cateva erori cum ca anumite functii nu sunt definite si am bagat tot ce era in folderul respectiv.

LINK: https://github.com/CyberMor/sampvoice - Am dat pe un link de mai jos si am luat versiunea 2.4 pentru linux (am un server pe host), dar am luat si versiunea de windows.

POZA:  

image.png

W0W

Link to comment
Share on other sites

Acum 7 minute, treflarino a spus:

Ne arati si liniile? ????‍♀️

#include <sampvoice>

new SV_GSTREAM:player_stream[MAX_PLAYERS];  // Global variable that will hold the stream for each player

public OnGameModeInit() {
    sv_init(6000, SV_FREQUENCY_VERY_HIGH, SV_VOICE_RATE_100MS);  // Initializing plugin's settings
    return 1;
}

public OnPlayerConnect(playerid) {
    // Checking availability and relevance of the client plugin
    if(sv_get_version(playerid) == SV_NULL) {
        SendClientMessage(playerid, -1, "You don't have SampVoice installed");
    } else if(sv_get_version(playerid) < SV_VERSION) {
        SendClientMessage(playerid, -1, "You're holding an old version of the plugin, possibly incompatiable. update it.");
    }
    // Checking microphone availability
    if(!sv_has_micro(playerid)) {
        SendClientMessage(playerid, -1, "You don't have a microphone connected. You can head, but not talk.");
    }
    // Creating a global stream for the player and connecting him to it
    player_stream[playerid] = sv_gstream_create();
    sv_stream_player_attach(player_stream[playerid], playerid);
    // Installation of player microphone activation keys
    sv_set_key(playerid, 0x32); // 0x32 - this is the code for the key '2'
    return 1;
}

public OnPlayerDisconnect(playerid) {
    sv_stream_delete(player_stream[playerid]);  // Deleting global player stream
    return 1;
}

public SV_BOOL:OnPlayerVoice(
    SV_UINT:playerid,   // ID of the sender
    SV_PACKET:packet,   // Packet descriptor
    SV_UINT:volume      // Volume level [0-32768]
) {
    sv_send_packet(packet, player_stream[playerid]);    // Sending back to the player
	return SV_TRUE;     // Delete the packet? (SV_TRUE - yes, SV_FALSE - no)
}

W0W

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...