Ajuda Escudo jб feito sу que com erro: -
davi54723 - 14.08.2012
Код:
#include <a_samp>
#include <core>
#include <float>
public OnPlayerCommandText(playerid, cmdtext)
{
if (strcmp("/escudo", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pLeader] != 1 && PlayerInfo[playerid][pMember] != 1)
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й LSPD.");
return 0x01;
}
else if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6, 1748.5192,-1552.4083,-12.2411))
{
format(string, sizeof(string), "%s retira o seu escudo do armбrio e o coloca.", sendername);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerHealth(playerid, 200);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк pode retirar o escudo a qualquer momento usando, /retiraritens.");
EscudoFrente(playerid);
return 0x01;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й oficial ou nгo estб no Armбrio!");
return 0x01;
}
}
if (strcmp("/escudoc", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pLeader] != 1 && PlayerInfo[playerid][pMember] != 1)
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й LSPD.");
return 0x01;
}
else if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6, 1748.5192,-1552.4083,-12.2411))
{
format(string, sizeof(string), "%s retira o seu escudo do armбrio e o coloca nas suas costas.", sendername);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
EscudoCostas(playerid);
return 0x01;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й oficial ou nгo estб no Armбrio!");
return 0x01;
}
}
if (strcmp("/retiraritens", cmdtext, true, 10) == 0 || strcmp("/removeritens", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pLeader] != 1 && PlayerInfo[playerid][pMember] != 1)
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й LSPD.");
return 0x01;
}
if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6, 1748.5192,-1552.4083,-12.2411))
{
format(string, sizeof(string), "%s guarda os seus itens no armбrio.", sendername);
SetPlayerHealth(playerid, 100);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
return 0x01;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й oficial ou nгo estб no Armбrio!");
return 0x01;
}
}
C:\Users\Daviwindows\Desktop\Equipe.pwn(6) : error 025: function heading differs from prototype
C:\Users\Daviwindows\Desktop\Equipe.pwn(
: error 035: argument type mismatch (argument 2)
C:\Users\Daviwindows\Desktop\Equipe.pwn(10) : error 017: undefined symbol "PlayerInfo"
C:\Users\Daviwindows\Desktop\Equipe.pwn(10) : warning 215: expression has no effect
C:\Users\Daviwindows\Desktop\Equipe.pwn(10) : error 001: expected token: ";", but found "]"
C:\Users\Daviwindows\Desktop\Equipe.pwn(10) : error 029: invalid expression, assumed zero
C:\Users\Daviwindows\Desktop\Equipe.pwn(10) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
6 Errors.
Alguйm me ajuda?
Re: Ajuda Escudo jб feito sу que com erro: -
davi54723 - 14.08.2012
Tem como alguйm fazer um para mim, tipo que tenha aparкncia de escudo, e crie alguma coisa invisнvel para proteger.
Agradeзo a todos
Re: Ajuda Escudo jб feito sу que com erro: -
GhosT_[] - 14.08.2012
Quer cafй e bolacha tambem?
Re: Ajuda Escudo jб feito sу que com erro: -
Don_Speed - 14.08.2012
Callback OnPlayerCommandText esta sem seu return de fechamento isso que causiona o erro!
Re: Ajuda Escudo jб feito sу que com erro: -
EduardoRFS - 14.08.2012
varias coisas vc podia marcar qual linha й a 10 e a 6
Re: Ajuda Escudo jб feito sу que com erro: -
Delay - 14.08.2012
1є GAMEMODE Dele й em dcmd_
Definiзгo de org nгo possuem a playerinfo.
Team_Cop a Definiзгo
pawn Код:
if(gTeam[playerid] != TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_CIA)
OnPlayerCommandText blabla caracteres ..
Cуdigo
Sem parametro \/, caso queira usar modifique, nao й nem necessario o params ^^
pawn Код:
dcmd_escudo(playerid,params[])
{
#pragma unused params
if(Player[playerid][pMember] == TEAM_COP || Player[playerid][pLeader] == TEAM_COP)
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й LSPD.");
return 1;
}
else if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6, 1748.5192,-1552.4083,-12.2411))
{
SetPlayerAttachedObject(playerid, 1, 19142, 1, 1036831949, 1028443341, 0, 0, 0, 0, 1065353216, 1065353216, 1065353216);
SetPlayerAttachedObject(playerid, 2, 19141, 2, 1038174126, 0, 0, 0, 0, 0, 1065353216, 1065353216, 1065353216);
SetPlayerAttachedObject(playerid, 3, 18637, 13, 1051931443, 0, 0, 0, 0, 1127481344, 1065353216, 1065353216, 1065353216);
SetPlayerAttachedObject(playerid, 4, 18642, 7, 1036831949, 0, 3185657774, 0, 3266576384, 1119092736, 1065353216, 1065353216, 1065353216);
GivePlayerWeapon(playerid, 3, 1);
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, 0xFDE39DAA, "Equipamentos colocados!.");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й oficial ou nгo estб no Armбrio!");
return 1;
}
}
-
-
Adaptando o ProxDetector
-
1є
pawn Код:
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
Agуra adicione o
pawn Код:
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
no cуdigo.
Public Prox
pawn Код:
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid) && GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//radi = 2.0; //Trigger Radius
for(new i = 0; i <= HighestID; i++)
{
//if(IsPlayerConnected(i) && GetPlayerState(i) != PLAYER_STATE_SPECTATING)
if(IsPlayerConnected(i))
{
if(!BigEar[i])
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if(((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if(((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if(((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if(((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
else
{
SendClientMessage(i, col1, string);
}
}
}
}
return 1;
}
Ficando:
pawn Код:
dcmd_escudo(playerid,params[])
{
#pragma unused params
if(Player[playerid][pMember] == TEAM_COP || Player[playerid][pLeader] == TEAM_COP)
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й LSPD.");
return 1;
}
else if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6, 1748.5192,-1552.4083,-12.2411))
{
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerAttachedObject(playerid, 1, 19142, 1, 1036831949, 1028443341, 0, 0, 0, 0, 1065353216, 1065353216, 1065353216);
SetPlayerAttachedObject(playerid, 2, 19141, 2, 1038174126, 0, 0, 0, 0, 0, 1065353216, 1065353216, 1065353216);
SetPlayerAttachedObject(playerid, 3, 18637, 13, 1051931443, 0, 0, 0, 0, 1127481344, 1065353216, 1065353216, 1065353216);
SetPlayerAttachedObject(playerid, 4, 18642, 7, 1036831949, 0, 3185657774, 0, 3266576384, 1119092736, 1065353216, 1065353216, 1065353216);
GivePlayerWeapon(playerid, 3, 1);
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, 0xFDE39DAA, "Equipamentos colocados!.");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й oficial ou nгo estб no Armбrio!");
return 1;
}
}
-
USando o exemplo, converta os proximos comandos:
pawn Код:
if (strcmp("/escudoc", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pLeader] != 1 && PlayerInfo[playerid][pMember] != 1)
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й LSPD.");
return 0x01;
}
else if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6, 1748.5192,-1552.4083,-12.2411))
{
format(string, sizeof(string), "%s retira o seu escudo do armбrio e o coloca nas suas costas.", sendername);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
EscudoCostas(playerid);
return 0x01;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й oficial ou nгo estб no Armбrio!");
return 0x01;
}
}
if (strcmp("/retiraritens", cmdtext, true, 10) == 0 || strcmp("/removeritens", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pLeader] != 1 && PlayerInfo[playerid][pMember] != 1)
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й LSPD.");
return 0x01;
}
if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6, 1748.5192,-1552.4083,-12.2411))
{
format(string, sizeof(string), "%s guarda os seus itens no armбrio.", sendername);
SetPlayerHealth(playerid, 100);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
return 0x01;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й oficial ou nгo estб no Armбrio!");
return 0x01;
}
}
Re: Ajuda Escudo jб feito sу que com erro: -
davi54723 - 14.08.2012
RESOLVIDO