//forward alarme veiculo
forward AlarmeVeiculo(playerid);
public AlarmeVeiculo(playerid)
{
PlayerPlaySound(playerid, 1147, PlayerInfo[playerid][pVposX], PlayerInfo[playerid][pVposY], PlayerInfo[playerid][pVposZ]);
return 1;
}
//comando para iniciar alarme
CMD:alarme(playerid)
{
if(!PlayerInfo[playerid][pVConectado]) return SendClientMessage(playerid, Cor_Vermelha, "| ERRO | Seu Veiculo precisa estar conectado para poder ativar o alarme.");
KillTimer(TimerAlarmeVeiculo[playerid]);
GetVehiclePos(VeiculoPessoalID[playerid], PlayerInfo[playerid][pVposX], PlayerInfo[playerid][pVposY], PlayerInfo[playerid][pVposZ]);
for( new i=0;i<=MAX_VEHICLES;i++)
{
//comecar o alarme de veiculo
TimerAlarmeVeiculo[playerid] = SetTimerEx("AlarmeVeiculo", 1300, true, "i", i);
}
return 1;
}
//comando para iniciar alarme
CMD:alarme(playerid)
{
if(!PlayerInfo[playerid][pVConectado]) return SendClientMessage(playerid, Cor_Vermelha, "| ERRO | Seu Veiculo precisa estar conectado para poder ativar o alarme.");
KillTimer(TimerAlarmeVeiculo[playerid]);
GetVehiclePos(VeiculoPessoalID[playerid], PlayerInfo[playerid][pVposX], PlayerInfo[playerid][pVposY], PlayerInfo[playerid][pVposZ]);
for( new i=0;i<=MAX_VEHICLES;i++)
{
//comecar o alarme de veiculo
TimerAlarmeVeiculo[playerid] = SetTimerEx("AlarmeVeiculo", 1300, true, "i", playerid); /*resolvido*/
}
return 1;
}
CMD:alarme(playerid) { if(!PlayerInfo[playerid][pVConectado]) return SendClientMessage(playerid, Cor_Vermelha, "| ERRO | Seu Veiculo precisa estar conectado para poder ativar o alarme."); KillTimer(TimerAlarmeVeiculo[playerid]); GetVehiclePos(VeiculoPessoalID[playerid], PlayerInfo[playerid][pVposX], PlayerInfo[playerid][pVposY], PlayerInfo[playerid][pVposZ]); TimerAlarmeVeiculo[playerid] = SetTimerEx("AlarmeVeiculo", 1300, true, "i", playerid); //Playerid para pegar as variбveis da posiзгo do veнculo return 1; } forward AlarmeVeiculo(playerid); public AlarmeVeiculo(playerid) { foreach(new i : Player) { //Por mim ele vai mandar o som do alarme nesta posiзгo para todos os jogadores perto PlayerPlaySound(i, 1147, PlayerInfo[playerid][pVposX], PlayerInfo[playerid][pVposY], PlayerInfo[playerid][pVposZ]); } return 1; }
Nenhum dos 2 tem lуgica, eu acho que o meu tambйm nгo, mas tenta
//Nгo testei Код:
CMD:alarme(playerid) { if(!PlayerInfo[playerid][pVConectado]) return SendClientMessage(playerid, Cor_Vermelha, "| ERRO | Seu Veiculo precisa estar conectado para poder ativar o alarme."); KillTimer(TimerAlarmeVeiculo[playerid]); GetVehiclePos(VeiculoPessoalID[playerid], PlayerInfo[playerid][pVposX], PlayerInfo[playerid][pVposY], PlayerInfo[playerid][pVposZ]); TimerAlarmeVeiculo[playerid] = SetTimerEx("AlarmeVeiculo", 1300, true, "i", playerid); //Playerid para pegar as variбveis da posiзгo do veнculo return 1; } forward AlarmeVeiculo(playerid); public AlarmeVeiculo(playerid) { foreach(new i : Player) { //Por mim ele vai mandar o som do alarme nesta posiзгo para todos os jogadores perto PlayerPlaySound(i, 1147, PlayerInfo[playerid][pVposX], PlayerInfo[playerid][pVposY], PlayerInfo[playerid][pVposZ]); } return 1; } |
C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\pawno\include\DOF2.inc(467) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\pawno\include\DOF2.inc(576) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\pawno\include\DOF2.inc(984) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\pawno\include\DOF2.inc(1059) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\pawno\include\DOF2.inc(1339) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\pawno\include\DOF2.inc(1368) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\pawno\include\DOF2.inc(1526) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\pawno\include\DOF2.inc(1667) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(1367) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(1384) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(1409) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(1424) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(4076) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(5222) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(5505) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(5516) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(5602) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(5631) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(5715) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(5929) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(5949) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(6051) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(6431) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(6541) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(6774) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(6826) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(8038) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(8066) : warning 219: local variable "i" shadows a variable at a preceding level C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\gamemodes\GM.pwn(8084) : error 017: undefined symbol "foreach" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
forward AlarmeVeiculo(playerid);
public AlarmeVeiculo(playerid)
{
for(new i; i < MAX_PLAYERS; i++) { //Por mim ele vai mandar o som do alarme nesta posiзгo para todos os jogadores perto
if(IsPlayerConnected(i) {
PlayerPlaySound(i, 1147, PlayerInfo[playerid][pVposX], PlayerInfo[playerid][pVposY], PlayerInfo[playerid][pVposZ]);
}
}
return 1;
}
Nгo tem foreach.. recomendo usar, com ele vocк consegue fazer muitas coisas, ler esse tutorial
https://sampforum.blast.hk/showthread.php?tid=625227 PHP код:
|
C:\Users\Lukas\Desktop\Meus Arqs\PROGRAMADOR\pawno\include\y_iterate.inc(102) : fatal error 100: cannot read from file: "..\YSI_Internal\y_compilerdata"