24.12.2011, 03:16
Galera, to montando um sistema de Bomba que explode com Detonador...
E to meio enrrolado numa coisa aqui:
Este й o code Inteiro:
Porem eu recebo Varios Erros e Warnings. Mais, por ventura, NENHUM deles estб nas linhas do codigo O.o
Vejam os Erros e Warnings:
Repitindo, NENHUM dos Erros e Warnings acima estгo nas linhas do Sistema de Bombas...
Porem, se eu retirar a funзгo:
Eu consigo copilar sem erros, comprar e plantar minhas bombas, mais obviamente claro que nao conssigo detonalas.
Aonde estou errando ? HEEELP, /To quase com 50Posts *-*
E to meio enrrolado numa coisa aqui:
Este й o code Inteiro:
pawn Код:
// TOPO
new Bomba[MAX_PLAYER] = -2;
//OnCommandText
if(strcmp(cmdtext, "/comprarbomba", true) == 0)
{
if(Bomba[playerid] != -2) return SendClientMessage(playerid, AMARELO_ATENCAO, "Vocк jб tem uma bomba. ( /plantarbomba )");
Bomba[playerid] = -1
SendClientMessage(playerid, -1, "Vocк comprou uma bomba e isso lhe custou 1000");
GameTextForPlayer(playerid, "~w~/plantar~r~bomba~w~ !!", 3000, 5);
GivePlayerMoney(playerid, -10000);
return 1;
}
if(strcmp(cmdtext, "/plantarbomba", true) == 0)
{
new Float:bx, Float: by, Float: bz
if(Bomba[playerid] != -1) return SendClientMessage(playerid, -1, "Vocк nгo tem uma bomba. /Comprarbomba");
GetPlayerPos(playerid, bx, by, bz);
SendClientMessage(playerid, AMARELO_ATENCAO, "Bomba Plaatada com Sucesso. /edetonarbomba para Detona-la");
Bomba[playerid] = CreateObject(1654, bx+1, by, bz-0.8, 0, 0, 0);
return 1;
}
if(strcmp(cmdtext, "/detonar", true) == 0)
SetTimerEx("Detonar", 6000, false, "ffbbb", playerid, Bomba[playerid]);
Bomba[playerid] = -2;
GameTextForPlayer(playerid, "5", 1000, 6);
GameTextForPlayer(playerid, "4", 1000, 6);
GameTextForPlayer(playerid, "3", 1000, 6);
GameTextForPlayer(playerid, "2", 1000, 6);
GameTextForPlayer(playerid, "1", 1000, 6);
return 1;
}
// FIM DO MODE.
forward Detonar(pID, bomba, Float:x, Float:y, Float:z);
public Detonar(pID, bomba, Float:x, Float:y, Float:z)
{
DestroyObject(bomba);
CreateExplosion(x, y, z, 10, 2000);
CreateExplosion(x+2, y+2, z+2, 10, 2000);
CreateExplosion(x+3, y+3, z+3, 10, 2000);
GameTextForPlayer(pID,"~r~Bomba~w~ detonada com sucesso.", 3000, 5);
return 1;
}
Vejam os Erros e Warnings:
Код:
D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(241) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(244) : error 021: symbol already defined: "GetPlayerPos" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(250) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(252) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(255) : error 021: symbol already defined: "GetPlayerPos" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(257) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(259) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(267) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(269) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(272) : error 021: symbol already defined: "GetPlayerPos" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(274) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(277) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(281) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(283) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(286) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(291) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(294) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(298) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(301) : error 010: invalid function or declaration D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(343) : warning 219: local variable "x" shadows a variable at a preceding level D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(343) : warning 219: local variable "y" shadows a variable at a preceding level D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(385) : warning 219: local variable "x" shadows a variable at a preceding level D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(385) : warning 219: local variable "y" shadows a variable at a preceding level D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(385) : warning 219: local variable "z" shadows a variable at a preceding level D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103) : warning 204: symbol is assigned a value that is never used: "ArenaDM" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "X" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "Y" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "Z" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "slx" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "sly" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "slz" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "x" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "y" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "z" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "zlx" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "zly" D:\JOGOS\GTA San Andreas\Server SAMP\gamemodes\teste.pwn(103 -- 395) : warning 203: symbol is never used: "zlz"
Porem, se eu retirar a funзгo:
pawn Код:
if(strcmp(cmdtext, "/detonar", true) == 0)
SetTimerEx("Detonar", 6000, false, "ffbbb", playerid, Bomba[playerid]);
Bomba[playerid] = -2;
GameTextForPlayer(playerid, "5", 1000, 6);
GameTextForPlayer(playerid, "4", 1000, 6);
GameTextForPlayer(playerid, "3", 1000, 6);
GameTextForPlayer(playerid, "2", 1000, 6);
GameTextForPlayer(playerid, "1", 1000, 6);
return 1;
}
Aonde estou errando ? HEEELP, /To quase com 50Posts *-*