29/06/2023 13:43
(Esta mensagem foi modificada pela última vez a: 29/06/2023 14:00 por GSBRUXOyt.)
(28/06/2023 13:17)Aranha Escreveu: codigo que esta no pastebin
Código:#include <a_samp>
#include <core>
#include <float>
#include <sampvoice>
main() {}
new SV_GSTREAM:gstream;
new SV_LSTREAM:lstream[MAX_PLAYERS] = { SV_NULL, ... };
public OnGameModeInit()
{
//SvDebug(SV_TRUE);
gstream = SvCreateGStream(0xffff0000, "G"); // blue color
return 1;
}
public OnPlayerConnect(playerid)
{
if(!SvGetVersion(playerid))
{
SendClientMessage(playerid, -1, "O Plugin SAMPVoice não foi encontrado");
}
else if(!SvHasMicro(playerid))
{
SendClientMessage(playerid, -1, "Seu microfone não foi encontrado");
}
else
{
lstream[playerid] = SvCreateDLStreamAtPlayer(40.0, SV_INFINITY, playerid, 0xff0000ff, "L");
SendClientMessage(playerid, -1, "Seu VOIP foi carregado com sucesso!");
if (gstream) SvAttachListenerToStream(gstream, playerid);
SvAddKey(playerid, 0x42);//Z
SvAddKey(playerid, 0x5A);//B
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(lstream[playerid])
{
SvDeleteStream(lstream[playerid]);
lstream[playerid] = SV_NULL;
}
return 1;
}
public SV_VOID:OnPlayerActivationKeyPress(SV_UINT:playerid, SV_UINT:keyid)
{
if(keyid == 0x42 && lstream[playerid])
{
SvAttachSpeakerToStream(lstream[playerid], playerid); //local
}
if(keyid == 0x5A && gstream)
{
if(IsPlayerAdmin(playerid))
{
SvAttachSpeakerToStream(gstream, playerid); //global
}
}
}
public SV_VOID:OnPlayerActivationKeyRelease(SV_UINT:playerid,SV_UINT:keyid)
{
if(keyid == 0x42 && lstream[playerid])
{
SvDetachSpeakerFromStream(lstream[playerid], playerid);
}
if(keyid == 0x5A && gstream)
{
if(IsPlayerAdmin(playerid))
{
SvDetachSpeakerFromStream(gstream, playerid);
}
}
}
ok mas uma pergunta, onde coloco os arquivos do voip na gamemode, na pasta plugins
outro erro aconteceu ao colocar o voip
esses sao os erros:
Código PHP:
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(43) : warning 204: symbol is assigned a value that is never used: "lstream"
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(42) : warning 203: symbol is never used: "gstream"
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(55) : warning 217: loose indentation
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(55) : error 017: undefined symbol "gstream"
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(56) : warning 217: loose indentation
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(77) : warning 217: loose indentation
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(83) : error 017: undefined symbol "lstream"
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(83) : warning 215: expression has no effect
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(83) : error 001: expected token: ";", but found "]"
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(83) : error 029: invalid expression, assumed zero
C:\Users\Marcos\Desktop\Secrets RP\gamemodes\game.pwn(83) : fatal error 107: too many error messages on one line
e esse e meu codigo por completo:
Código:
//Desenvolvido Por Gang Secrets
#include <a_samp>
#include <zcmd>
#include <streamer>
#include <core>
#include <float>
#include <sampvoice>
#if defined FILTERSCRIPT
//Cores
#define VERMELHO 0xFF9C9CF6
#define VERDE_BEM_CLARO 0xC5FFC2F6
#define AZUL_BEM_CLARO 0xACF6FFF6
#define ROXO_BEM_CLARO 0xCBC2FFF6
#define COR_ROSA_CLARO 0xFFB7FFF6
#define COR_PRETA_TRANSPARENTE 0x00000051
#define COR_VERDE_AMARELADA 0xD8FF12F6
#define COR_BRANCA 0xFFFFFFF6
#define COR_CINZA 0xD2D2D2F6
#define COR_VERDE_FOLHA 0x90BC70F6
#define COR_LARANJA 0xFFA500F6
#define COR_AMARELO 0xEBEB00F6
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Desenvolvido Por Gang Secrets");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
new SV_GSTREAM:gstream;
new SV_LSTREAM:lstream[MAX_PLAYERS] = { SV_NULL, ... };
print("\n----------------------------------");
print("Desenvolvido Por Gang Secrets");
print("----------------------------------\n");
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Roleplay");
AddPlayerClass(2,1475.6208,-1624.2548,14.0469,59.6218, 0, 0, 0, 0, 0, 0);
DisableInteriorEnterExits();
UsePlayerPedAnims();
gstream = SvCreateGStream(0xffff0000, "G"); // blue color
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetSpawnInfo(playerid, 0, 2, 2096.6499,1283.4825,10.8203, 0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
return 1;
}
public OnPlayerConnect(playerid)
{
if(!SvGetVersion(playerid))
{
SendClientMessage(playerid, -1, "O Plugin SAMPVoice não foi encontrado");
}
else if(!SvHasMicro(playerid))
{
SendClientMessage(playerid, -1, "Seu microfone não foi encontrado");
}
else
{
lstream[playerid] = SvCreateDLStreamAtPlayer(40.0, SV_INFINITY, playerid, 0xff0000ff, "L");
SendClientMessage(playerid, -1, "Seu VOIP foi carregado com sucesso!");
if (gstream) SvAttachListenerToStream(gstream, playerid);
SvAddKey(playerid, 0x42);//Z
SvAddKey(playerid, 0x5A);//B
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(lstream[playerid])
{
SvDeleteStream(lstream[playerid]);
lstream[playerid] = SV_NULL;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
cmd_entrar(playerid, "");
cmd_sair(playerid, "");
}
return true;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public SV_VOID:OnPlayerActivationKeyPress(SV_UINT:playerid, SV_UINT:keyid)
{
if(keyid == 0x42 && lstream[playerid])
{
SvAttachSpeakerToStream(lstream[playerid], playerid); //local
}
if(keyid == 0x5A && gstream)
{
if(IsPlayerAdmin(playerid))
{
SvAttachSpeakerToStream(gstream, playerid); //global
}
}
}
public SV_VOID:OnPlayerActivationKeyRelease(SV_UINT:playerid,SV_UINT:keyid)
{
if(keyid == 0x42 && lstream[playerid])
{
SvDetachSpeakerFromStream(lstream[playerid], playerid);
}
if(keyid == 0x5A && gstream)
{
if(IsPlayerAdmin(playerid))
{
SvDetachSpeakerFromStream(gstream, playerid);
}
}
}
CMD:irlojadearmas(player, params[])
{
SetPlayerPos(player, 1368.9933, -1279.6396, 13.5469);
return 1;
}
CMD:entrar(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1368.9933, -1279.6396, 13.5469))
{
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, 286.148986, -40.644397, 1001.515625);
SendClientMessage(playerid, 0xFF9C9CF6, "Voce entrou Na AmmuNation.");
}
return true;
}
CMD:sair(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986, -40.644397, 1001.515625))
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1368.9933, -1279.6396, 13.5469);
}
return true;
}
#endif
Citar:como disse anteriormente, sou iniciante em programacao de servidores, e preciso da ajuda para saber o que esta errado.
Citar:outra coisa e que lembrei onde coloco os arquivos do voip, so + dll na pasta plugins e inc na include do pawno.