#include <a_samp> #define COLOR_WHITE 0xFFFFFFAA native PlayAudioStreamForPlayer(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0); native StopAudioStreamForPlayer(playerid); public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/sb", cmdtext, true, 10) == 0) { SendClientMessage(playerid, COLOR_WHITE, "[USO] /sb on - Ativa os Sons Ambientais"); SendClientMessage(playerid, COLOR_WHITE, "/sb off - Desativa os Sons Ambientais"); return 1; } if (strcmp("/sb on", cmdtext, true, 10) == 0) { SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental Ativado"); PlayAudioStreamForPlayer(playerid, "http://dc404.4shared.com/img/130907008/f91252f3/dlink__2Fdownload_2FZ1mWznVu_3Ftsid_3D20120304-182917-ef307e76/preview.mp3", 2075.5352 , 1306.7965, 10.6719, 50.0, 1); return 1; } if (strcmp("/sb off", cmdtext, true, 10) == 0) { SendClientMessage(playerid, COLOR_WHITE, "[BSL] Som Ambiental Desativado"); StopAudioStreamForPlayer(playerid); return 1; } return 1; }
PlayAudioStreamForPlayer(playerid, "http://dc404.4shared.com/img/130907008/f91252f3/dlink__2Fdownload_2FZ1mWznVu_3Ftsid_3D20120304-182917-ef307e76/preview.mp3");
#include <a_samp>
#define COLOR_WHITE 0xFFFFFFAA
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[128];
new tmp[128];
cmd = strtok(cmdtext, idx);
//---------------- COMANDOS ----------------//
if(strcmp("/sb", cmdtext, true, 10) == 0)
{
new statusamb[4];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Uso correto: /sb on - Ativa os Sons Ambientais.");
SendClientMessage(playerid, COLOR_WHITE, "Uso correto: /sb off - Desativa os Sons Ambientais.");
return 1;
}
statusamb = strval(tmp);
if(strcmp(statusamb, "on", true) == 0)
{
SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental Ativado");
PlayAudioStreamForPlayer(playerid, "http://dc404.4shared.com/img/130907008/f91252f3/dlink__2Fdownload_2FZ1mWznVu_3Ftsid_3D20120304-182917-ef307e76/preview.mp3", 2075.5352 , 1306.7965, 10.6719, 50.0, 1);
}
if(strcmp(statusamb, "off", true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "[BSL] Som Ambiental Desativado");
StopAudioStreamForPlayer(playerid);
}
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "[BSL] - Comando Inexistente");
}
new Musica[MAX_PLAYERS];
if(strcmp("/sb", cmdtext, true, 10) == 0)
{
new statusamb[4];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Uso correto: /sb on - Ativa os Sons Ambientais.");
SendClientMessage(playerid, COLOR_WHITE, "Uso correto: /sb off - Desativa os Sons Ambientais.");
return 1;
}
if(strcmp(statusamb, "on", true) == 0)
{
if(Musica[playerid] == 1)
{
SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental jб esб Ativado");
return 1;
}
Musica[playerid] = 1;
SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental Ativado");
PlayAudioStreamForPlayer(playerid, "http://dc404.4shared.com/img/130907008/f91252f3/dlink__2Fdownload_2FZ1mWznVu_3Ftsid_3D20120304-182917-ef307e76/preview.mp3", 2075.5352 , 1306.7965, 10.6719, 50.0, 1);
}
if(strcmp(statusamb, "off", true) == 0)
{
if(Musica[playerid] == 0)
{
SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental jб esб Desativado");
return 1;
}
Musica[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, "[BSL] Som Ambiental Desativado");
StopAudioStreamForPlayer(playerid);
}
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "[BSL] - Comando Inexistente");
}
Topo do GM:
pawn Код:
pawn Код:
|
CTRL C + CTRL V, oque vocк adicionou ainda adicionou incorreto, deveria usar bool.
|
#include <a_samp> #define COLOR_WHITE 0xFFFFFFAA new Musica[MAX_PLAYERS]; native PlayAudioStreamForPlayer(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0); native StopAudioStreamForPlayer(playerid); public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp("/sb", cmdtext, true, 10) == 0) { new statusamb[4]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "Uso correto: /sb on - Ativa os Sons Ambientais."); SendClientMessage(playerid, COLOR_WHITE, "Uso correto: /sb off - Desativa os Sons Ambientais."); return 1; } if(strcmp(statusamb, "on", true) == 0) { if(Musica[playerid] == 1) { SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental jб esб Ativado"); return 1; } Musica[playerid] = 1; SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental Ativado"); PlayAudioStreamForPlayer(playerid, "http://dc404.4shared.com/img/130907008/f91252f3/dlink__2Fdownload_2FZ1mWznVu_3Ftsid_3D20120304-182917-ef307e76/preview.mp3", 2075.5352 , 1306.7965, 10.6719, 50.0, 1); } if(strcmp(statusamb, "off", true) == 0) { if(Musica[playerid] == 0) { SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental jб esб Desativado"); return 1; } Musica[playerid] = 0; SendClientMessage(playerid, COLOR_WHITE, "[BSL] Som Ambiental Desativado"); StopAudioStreamForPlayer(playerid); } return 1; } return SendClientMessage(playerid, COLOR_WHITE, "[BSL] - Comando Inexistente"); }
C:\Users\User4\Desktop\acesorios.pwn(15) : error 017: undefined symbol "tmp" C:\Users\User4\Desktop\acesorios.pwn(15) : error 017: undefined symbol "strtok" C:\Users\User4\Desktop\acesorios.pwn(16) : error 017: undefined symbol "tmp"
#include <a_samp>
#define COLOR_WHITE 0xFFFFFFAA
new Musica[MAX_PLAYERS];
native PlayAudioStreamForPlayer(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0);
native StopAudioStreamForPlayer(playerid);
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[128];
new tmp[128];
cmd = strtok(cmdtext, idx);
if(strcmp("/sb", cmdtext, true, 10) == 0)
{
new statusamb[4];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Uso correto: /sb on - Ativa os Sons Ambientais.");
SendClientMessage(playerid, COLOR_WHITE, "Uso correto: /sb off - Desativa os Sons Ambientais.");
return 1;
}
if(strcmp(statusamb, "on", true) == 0)
{
if(Musica[playerid] == 1)
{
SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental jб esб Ativado");
return 1;
}
Musica[playerid] = 1;
SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental Ativado");
PlayAudioStreamForPlayer(playerid, "http://dc404.4shared.com/img/130907008/f91252f3/dlink__2Fdownload_2FZ1mWznVu_3Ftsid_3D20120304-182917-ef307e76/preview.mp3", 2075.5352 , 1306.7965, 10.6719, 50.0, 1);
}
if(strcmp(statusamb, "off", true) == 0)
{
if(Musica[playerid] == 0)
{
SendClientMessage(playerid,COLOR_WHITE, "[BSL] Som Ambiental jб esб Desativado");
return 1;
}
Musica[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, "[BSL] Som Ambiental Desativado");
StopAudioStreamForPlayer(playerid);
}
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "[BSL] - Comando Inexistente");
}
Se nгo sabe nгo fala --' Eu poderia usar bool mas nгo quero, seria disperdicio de cйlula, sem falar que no seu CODE nгo a nada que ele pediu, vocк sу retirou native's (uauuu ela й uma genia), e vem falar do meu CODE, se vocк nгo sabe eu Compilei e Testei
![]() ![]() |
Aprenda a codar para vim discutir comigo, vocк usar 1 valor para uma variavel ao invez de usar bool, isso sim й desperdicio pergunte a todos aк ! E nem ajudou que ele me reputou
![]() |