for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 10, Xtar, Ytar, Ztar) && IsPlayerInRangeOfPoint(i, 10, x, y, z))
{
if (GetPlayerOrg(i) == org)
{
}
else
{
}
}
}
CMD:comando(playerid) { new Float:x1, Float:y1, Float:z1, name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME]; GetPlayerPos(playerid, x1, y1, z1); for(new i; i < MAX_PLAYERS; i++) { GetPlayerName(playerid, name1, sizeof(name1)); GetPlayerName(playerid, name2, sizeof(name2)); if(name1 != name2) { if(GetPlayerOrg(i) == GetPlayerOrg(playerid) && IsPlayerInRangeOfPoint(i, 10 , x1, y1, z1)) { //funзхes que acontece } else { //o que aconte se nгo tiver alguem da org perto } } } return 1; }
C:\Documents and Settings\Administrador\Desktop\server\Nova pasta\gamemodes\BSL.pwn(27554) : error 033: array must be indexed (variable "name1") C:\Documents and Settings\Administrador\Desktop\server\Nova pasta\gamemodes\BSL.pwn(27556) : error 017: undefined symbol "If" C:\Documents and Settings\Administrador\Desktop\server\Nova pasta\gamemodes\BSL.pwn(27694) : warning 225: unreachable code C:\Documents and Settings\Administrador\Desktop\server\Nova pasta\gamemodes\BSL.pwn(27694) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrador\Desktop\server\Nova pasta\gamemodes\BSL.pwn(27802) : error 075: input line too long (after substitutions) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
CMD:comando(playerid) { new Float:x1, Float:y1, Float:z1; GetPlayerPos(playerid, x1, y1, z1); for(new i; i < MAX_PLAYERS; i++) { if(i != playerid) { if(GetPlayerOrg(i) == GetPlayerOrg(playerid) && IsPlayerInRangeOfPoint(i, 10 , x1, y1, z1)) { //funзхes que acontece } else { //o que aconte se nгo tiver alguem da org perto } } } return 1; }
Код:
CMD:comando(playerid) { new Float:x1, Float:y1, Float:z1; GetPlayerPos(playerid, x1, y1, z1); for(new i; i < MAX_PLAYERS; i++) { if(i != playerid) { if(GetPlayerOrg(i) == GetPlayerOrg(playerid) && IsPlayerInRangeOfPoint(i, 10 , x1, y1, z1)) { //funзхes que acontece } else { //o que aconte se nгo tiver alguem da org perto } } } return 1; } |
CMD:comando(playerid)
{
new Float:x1, Float:y1, Float:z1;
GetPlayerPos(playerid, x1, y1, z1);
for(new i; i < MAX_PLAYERS; i++)
{
if(i != playerid)
{
if(GetPlayerOrg(i) == GetPlayerOrg(playerid) && IsPlayerInRangeOfPoint(i, 10 , x1, y1, z1))
{
// use break ou retorne a algum valor.
}
else
{
//o que aconte se nгo tiver alguem da org perto
}
}
}
// use break se for executar alguma coisa abaixo da loop, caso nгo for colcoar nada retorne a algum valor como 1
// e coloque a mensagem caso nгo tiver ninguйm perto do jogador
return 1;
}
///
CMD:comando(playerid)
{
new Float:x1, Float:y1, Float:z1;
GetPlayerPos(playerid, x1, y1, z1);
for(new i; i < MAX_PLAYERS; i++)
{
if(i != playerid)
{
if(GetPlayerOrg(i) == GetPlayerOrg(playerid) && IsPlayerInRangeOfPoint(i, 10 , x1, y1, z1))
{
return 1;
}
else
{
//o que aconte se nгo tiver alguem da org perto
}
}
}
SendClientMessage(playerid, -1, "Nгo hб ninguйm perto de vocк.");
return 1;
}
Funcao(playerid)
{
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && i != playerid)
{
if(GetPlayerOrg(i) == GetPlayerOrg(playerid) && IsPlayerInRangeOfPoint(i, 10.0, Pos[0], Pos[1], Pos[2])) return 1;
}
}
return 0;
}
CMD:Comando(playerid, params[])
{
if(Funcao(playerid))
{
// Se tiver alguйm perto dele
}
else
{
// Se nгo tiver alguem perto dele
}
return 1;
}
Manda a loop parar:
pawn Код:
pawn Код:
|
Funcao(playerid)
{
new Float: Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
for (new i; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && i != playerid)
{
if (GetPlayerOrg(i) == GetPlayerOrg(playerid) && IsPlayerInRangeOfPoint(i, 10.0, Pos[0], Pos[1], Pos[2])) return 1;
}
}
return 0;
}