Kako Ubaciti Samp Voice Chat.

Započeo Transportercina, Maj 28, 2020, 10:57:32 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

U ovom Tutorijalu Cu vam objasniti kako ubaciti Samp Voice Chat u Vas Gamemode Da bude Bez Erorra. Nadam se da ce vam Pomoci.


1. Sto treba da uradite je Da skinete ove plugine da ubacite u vas "Plugins" Folder od Servera.
Link: https://www.sendspace.com/file/ww8qbu
Virus Scan: https://www.virustotal.com/gui/file/01b3e6065d9390bddc4ccf908e4ede9339163346d48b31bcdd344a92d501f59d/detection

Dalje Morate skinuti ovo sa githuba: https://github.com/CyberMor/sampvoice
Virus Scan : Github

Kada ste to sve skinuli
"Server" Folder sve iz njega Ubacite u vas "Pawno Folder"
Nakon toga krece deo Skriptanja.[/b]

Sada ovo dobro pratite

[pawn]#include <a_samp>
#include <core>
#include <float>
#include <sampvoice>

#pragma tabsize 0

main() {}

new SV_GSTREAM:gstream;
new SV_LSTREAM:lstream[MAX_PLAYERS] = { SV_NULL, ... };

public SV_VOID:OnPlayerActivationKeyPress(
   SV_UINT:playerid,
   SV_UINT:keyid
) {
   if (keyid == 0x42 && lstream[playerid]) SvAttachSpeakerToStream(lstream[playerid], playerid);
   if (keyid == 0x5A && gstream) SvAttachSpeakerToStream(gstream, playerid);
}

public SV_VOID:OnPlayerActivationKeyRelease(
   SV_UINT:playerid,
   SV_UINT:keyid
) {
   if (keyid == 0x42 && lstream[playerid]) SvDetachSpeakerFromStream(lstream[playerid], playerid);
   if (keyid == 0x5A && gstream) SvDetachSpeakerFromStream(gstream, playerid);
}

public OnPlayerConnect(playerid) {

   if (!SvGetVersion(playerid)) SendClientMessage(playerid, -1, "Vasa verzija je zastarjela");
   else if (!SvHasMicro(playerid)) SendClientMessage(playerid, -1, "Nemate mikrofon");
       lstream[playerid] = SvCreateDLStreamAtPlayer(40.0, SV_INFINITY, playerid, 0xff0000ff, "L"); // red color
      SendClientMessage(playerid, -1, "Povezani ste na Voice server.");
      if (gstream) SvAttachListenerToStream(gstream, playerid);
      SvAddKey(playerid, 0x42);
      SvAddKey(playerid, 0x5A);

   return 1;

}

public OnPlayerDisconnect(playerid, reason) {

   if (lstream[playerid]) {
      SvDeleteStream(lstream[playerid]);
      lstream[playerid] = SV_NULL;
   }

   return 1;

}

public OnPlayerSpawn(playerid) {

   SetPlayerInterior(playerid,0);
   TogglePlayerClock(playerid,0);

   return 1;

}

public OnPlayerDeath(playerid, killerid, reason) {

      return 1;

}

SetupPlayerForClassSelection(playerid) {
   SetPlayerInterior(playerid,14);
   SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
   SetPlayerFacingAngle(playerid, 270.0);
   SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
   SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}

public OnPlayerRequestClass(playerid, classid) {
   SetupPlayerForClassSelection(playerid);
   return 1;
}

public OnGameModeInit() {

   //SvDebug(SV_TRUE);

   gstream = SvCreateGStream(0xffff0000, "G"); // blue color

   CreateVehicle(400, 1945.0226, 1321.6926, 9.1094, 180.2150, -1, -1, -1);
   Create3DTextLabel("TextLabel", 0x008080FF, 1945.0226, 1321.6926, 9.1094, 40.0, 0, 0);

   SetGameModeText("Bare Script");
   ShowPlayerMarkers(1);
   ShowNameTags(1);
   AllowAdminTeleport(1);

   AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);

   return 1;

}
[/pawn]
To je kod Voice chata iz Bare scripte sada iz toga prebacujete u svoj gamemode
1. Kada otvorite svoj gamemode u pawnu definisite ispod include <a_samp> includove
[pawn]
#include <core>
#include <float>
#include <sampvoice>[/pawn]

Nakon toga Pored ostalih varijabli "new" tu stavljate ispod njih

[pawn]new SV_GSTREAM:gstream;
new SV_LSTREAM:lstream[MAX_PLAYERS] = { SV_NULL, ... };[/pawn]

Nakon toga krecete kod ostalih "Public" Definicija stavite negde u sredini gde vi zelite
[pawn]
forward OnPlayerActivationKeyPress(playerid,keyid);
public SV_VOID:OnPlayerActivationKeyPress(
   SV_UINT:playerid,
   SV_UINT:keyid
) {
   if (keyid == 0x42 && lstream[playerid]) SvAttachSpeakerToStream(lstream[playerid], playerid);
   if (keyid == 0x5A && gstream) SvAttachSpeakerToStream(gstream, playerid);
}

forward OnPlayerActivationKeyRelease(playerid,keyid);
public SV_VOID:OnPlayerActivationKeyRelease(
   SV_UINT:playerid,
   SV_UINT:keyid
) {
   if (keyid == 0x42 && lstream[playerid]) SvDetachSpeakerFromStream(lstream[playerid], playerid);
   if (keyid == 0x5A && gstream) SvDetachSpeakerFromStream(gstream, playerid);
}[/pawn]


Nakon toga idete do funkcije "public OnPlayerConnect(playerid)" Kod nje na pocetku ispod stavljate ovaj Kod

[pawn]if (!SvGetVersion(playerid)) SendClientMessage(playerid, -1, "Vasa verzija je zastarjela");
   else if (!SvHasMicro(playerid)) SendClientMessage(playerid, -1, "Nemate mikrofon");
       lstream[playerid] = SvCreateDLStreamAtPlayer(40.0, SV_INFINITY, playerid, 0xff0000ff, "L"); // Crvena boja Dok Pricate u uglu vam se pojavljuje "L"
      SendClientMessage(playerid, -1, "Povezani ste na Voice server.");
      if (gstream) SvAttachListenerToStream(gstream, playerid);
      SvAddKey(playerid, 0x42);
      SvAddKey(playerid, 0x5A);

   return 1;

}
[/pawn]

Posle idete do funkcije "OnPlayerDisconnect"
I ispod nje stavljate ovaj kod:

[pawn]if (lstream[playerid]) {
      SvDeleteStream(lstream[playerid]);
      lstream[playerid] = SV_NULL;
   }

   return 1;

}[/pawn]

Nakon toga krecete do zadnje stavke koju treba da uradite, a to je idete do funkcije "OnGameModeInit" U njoj nalepite ovaj kod:

[pawn]
//SvDebug(SV_TRUE); ovo je log samp voice

   gstream = SvCreateGStream(0xffff0000, "G"); // Plava boja[/pawn]
To bi bilo to nadam se da sam vam pomogao ako sam nesta za boravio pisite dole :)

P.C. [pawn]SvAddKey(playerid, 0x42);[/pawn] Ovo "0x42" Znaci da se sa voicom Prica preko tipke "B" a  Ja vam ostavljam link kodova kojim mozete da promenite u tipku koju vi zelite



[pawn]
//Mis
#define VK_LEFTBUTTON 0x01
#define VK_RIGHTBUTTON 0x02
#define VK_MIDBUTTON 0x04

//Tastatura
#define VK_CANCEL 0x03
#define VK_BACKSPACE 0x08
#define VK_TAB 0x09
#define VK_CLEAR 0x0C
#define VK_ENTER 0x0D
#define VK_SHIFT 0x10 //Any of the 2 shift keys
#define VK_LSHIFT 0xA0 //Left Shift Key
#define VK_RSHIFT 0xA1 //Right shift key
#define VK_CTRL 0x11 //Any of the 2 control keys
#define VK_LCTRL 0xA2 //Left control key
#define VK_RCTRL 0xA3 //Right control key
#define VK_ALT 0x12
#define VK_CAPSLOCK 0x14
#define VK_ESCAPE 0x1B
#define VK_SPACE 0x20
#define VK_LEFT 0x25
#define VK_UP 0x26
#define VK_RIGHT 0x27
#define VK_DOWN 0x28
#define VK_SELECT 0x29
#define VK_INSERT 0x2D
#define VK_DELETE 0x2E
#define VK_HELP 0x2F

//Brojevi
#define VK_KEYB0 0x30
#define VK_KEYB1 0x31
#define VK_KEYB2 0x32
#define VK_KEYB3 0x33
#define VK_KEYB4 0x34
#define VK_KEYB5 0x35
#define VK_KEYB6 0x36
#define VK_KEYB7 0x37
#define VK_KEYB8 0x38
#define VK_KEYB9 0x39

//Numpedovi
#define VK_NUMLOCK 0x90
#define VK_NUMPAD0 0x60
#define VK_NUMPAD1 0x61
#define VK_NUMPAD2 0x62
#define VK_NUMPAD3 0x63
#define VK_NUMPAD4 0x64
#define VK_NUMPAD5 0x65
#define VK_NUMPAD6 0x66
#define VK_NUMPAD7 0x67
#define VK_NUMPAD8 0x68
#define VK_NUMPAD9 0x69
#define VK_MULTIPLY 0x6A
#define VK_ADD 0x6B
#define VK_SEPARATOR 0x6C
#define VK_SUBTRACT 0x6D
#define VK_DECIMAL 0x6E
#define VK_DIVIDE 0x6F

//Funkcijske tipke
#define VK_F1 0x70
#define VK_F2 0x71
#define VK_F3 0x72
#define VK_F4 0x73
#define VK_F5 0x74
#define VK_F6 0x75
#define VK_F7 0x76
#define VK_F8 0x77
#define VK_F9 0x78
#define VK_F10 0x79
#define VK_F11 0x7A
#define VK_F12 0x7B
#define VK_F13 0x7C
#define VK_F14 0x7D
#define VK_F15 0x7E
#define VK_F16 0x7F
#define VK_F17 0x80
#define VK_F18 0x81
#define VK_F19 0x82
#define VK_F20 0x83
#define VK_F21 0x84
#define VK_F22 0x85
#define VK_F23 0x86
#define VK_F24 0x87

//Slova
#define VK_A 0x41
#define VK_B 0x42
#define VK_C 0x43
#define VK_D 0x44
#define VK_E 0x45
#define VK_F 0x46
#define VK_G 0x47
#define VK_H 0x48
#define VK_I 0x49
#define VK_J 0x4A
#define VK_K 0x4B
#define VK_L 0x4C
#define VK_M 0x4D
#define VK_N 0x4E
#define VK_O 0x4F
#define VK_P 0x50
#define VK_Q 0x51
#define VK_R 0x52
#define VK_S 0x53
#define VK_T 0x54
#define VK_U 0x55
#define VK_V 0x56
#define VK_W 0x57
#define VK_X 0x58
#define VK_Y 0x59
#define VK_Z 0x5A
[/pawn]

Uzivajte zivi bili. :)
Poslednja Izmena: Maj 28, 2020, 10:59:12 PRE PODNE od Transportercina
Skripter On Duty
Developer on Insomnia Gaming[/size]

Koristan tutorijal, svaka čast majstore! :D

SA:MP Member Since: 14.05.2008
If one day the speed kills me, do not cry because I was smiling


ovog banovat odma

TIIIIIRRRRRRUUUUUU RIIIIIIIIIIIIIIIII RUUUUUUUUUUUUU

Jel samo ja jedini i dalje ne vidim svrhu voice chata?

Citat: Sploxs poslato Maj 28, 2020, 13:28:55 POSLE PODNE
Jel samo ja jedini i dalje ne vidim svrhu voice chata?
Nisi jedini, nema smisla ubacivat, kad postoje TS, discord

Citat: Sploxs poslato Maj 28, 2020, 13:28:55 POSLE PODNE
Jel samo ja jedini i dalje ne vidim svrhu voice chata?
Nema smisla iz jednog razloga, to je sto je psovanje i vrijeđanje preko voice chata, skoro pa nemoguce kontrolisati, za ostale stvari i nije loš, ali za manje zajednice naravno..

ovo se cekalo  :D :D :D :D
PAWN DEVELOPER - 2016

KAD JE NAJTEZE BUDI CVRST KAO CELIK
I SJAJI KAO NAJSKUPLJI DIJAMANT

VER MONT COMMUNITY

Kontakti:
FB: https://www.facebook.com/zmajko.youtube
IG: https://www.instagram.com/zmajkobrate


Glupo....
《》< PROFFESIONAL SCRIPTER > 《》



druze nista nisi objasnio vec si samo kopirao kod uz "POMOC": stavite ovo ovde, a ovo ovde itd.. Ne ide to tako, objasni sta sta radi ionako niko ne zna nista ovde da uradi sa tim voicom sve na isti fazon

Najs :) Nice :)
Balkan Moon v1.0 by Foxy

Owner // Scripter Balkan Moon

u Potpisu Foxy.

Ne pipaj lava Foxy, radi na BM-u :D :D :D
[4.7.2019] Respect For: Purda | Basovski | Mister Naithan | BICEL KO MI BUNTA | 7.9: Vasic[/b]

* Server [5.1.2019 Created]
* Scripter on Power Gaming
* Scripter on Night Life
* Scripter on Arena Gaming
* Scripter on duty (Balkan Moon)

[23.5.2k19] Messi u skriptanju hehe ;)
[7.8.2k19]OLD Minecraft Developer & Player (2016-2018)

#FOXYSCRIPT[/b]
MAPPER U POKUŠAJU :/[/b]

Jako loš tutorijal, jako loše objašnjen, tj ništa nije objašnjeno čemu služi kao što je i nikola_knezev gore rekao.. Jedino si objasnio da je 0xFF0000AA red color, haha, bravo... Pravićemo se da to nismo znali :P
A i taj voice ne bih koristio nikad pored discorda itd..