if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Nгo estбs logado.");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] (/an)uncio [texto]");
return 1;
}
{
if(GetPlayerVirtualWorld(playerid) == -1)
{
if ((!adds) && (PlayerInfo[playerid][mstrvbcAdmin] < 1))
{
format(string, sizeof(string), "Aguarda %d segundos para fazeres outro anъncio.", (addtimer/1000));
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
new payout = idx * 15;
if(GetPlayerEuros(playerid) < payout)
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:]Nгo tens dinheiro suficiente para fazeres publicidade.");
return 1;
}
GivePlayerEuros(playerid, - payout);
format(string, sizeof(string), "___________________________[Publicidade]___________________________");
SendClientMessageToAll(COLOR_LIGHTGREEN,string);
format(string, sizeof(string), "[Anъncio:] %s", result);
SendClientMessageToAll(COLOR_WHITE,string);
format(string, sizeof(string), "[Anъncio:] Publicidade por: %s - Nъmero De Telemуvel: %d.", GetPlayerNameEx(playerid),PlayerInfo[playerid][msPhoneNumber]);
SendClientMessageToAll(COLOR_WHITE,string);
SendClientMessageToAll(COLOR_LIGHTGREEN,"________________________________________________________________________________________________________________________");
if (PlayerInfo[playerid][mstrvbcAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
format(string, sizeof(string), " Caracteres contidos: %d - Preзo: %dЂ - Obrigado pelo seu anъncio.");
SendClientMessage(playerid,COLOR_WHITE,string);
PlayerActionMessage(playerid,15.0,"Deu algum dinheiro ao jornalista e fez o seu anuncio");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Nгo te encontras no Negуcio.");
}
}
}
return 1;
}
if(!strcmp("/meucomando",cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid,RAIO, CORDENADAX, CORDENADAY, CORDENADAZ))
{
SendClientMessage(playerid,COR,"[ERRO] Vai para o local correto para usares /meucomando");
}
return 1;
}
if(!IsPlayerInRangeOfPoint(playerid,raio, coordenadas do local)) return SendClientMessage(playerid,-1,"Vocк nгo estб no local.");
//resto do cmd
if(GetPlayerInterior(playerid) != interior q voce quer) return SendClientMessage(playerid,-1,"Vocк precisa tб no interior interiorid");
//resto do cmd
|
Podes usar: IsPlayerInRangeOfPoint
pawn Код:
Ajudei? +resp <---- |
if(!strcmp("/meucomando",cmdtext))
{
if(!IsPlayerInRangeOfPoint(playerid, RAIO, CORDENADAX, CORDENADAY, CORDENADAZ))
return SendClientMessage(playerid,COR,"[ERRO] Vai para o local correto para usares /meucomando");
return 1;
}
|
Errado.
pawn Код:
|
|
Errado.
pawn Код:
|
if(!strcmp("/meucomando",cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, RAIO, CORDENADAX, CORDENADAY, CORDENADAZ))
{
SendClientMessage(playerid,COR,"Vocк estб no local correto!");
}
return 1;
}
if(!strcmp("/meucomando",cmdtext))
{
if(!IsPlayerInRangeOfPoint(playerid, RAIO, CORDENADAX, CORDENADAY, CORDENADAZ))// !
{
SendClientMessage(playerid,COR,"[ERRO] Vai para o local correto para usares /meucomando");
}
return 1;
}

if(!strcmp("/meucomando",cmdtext))
{
if(!IsPlayerInRangeOfPoint(playerid, RAIO, CORDENADAX, CORDENADAY, CORDENADAZ)) return SendClientMessage(playerid,COR,"[ERRO] Vai para o local correto para usares /meucomando");
//funзoes do comando, exemplo:
SendClientMessage(playerid,-1,"Vocк digitou o comando no lugar certo e ganhou uma arminha :)");
GivePlayerWeapon(playerid, 24,100);
return 1;
}

if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Nгo estбs logado.");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] (/an)uncio [texto]");
return 1;
}
{
if(!IsPlayerInRangeOfPoint(playerid, 20.0, 364.1921,168.3376,1019.9844))
(SetPlayerInterior(playerid, 3));
};
{
if(GetPlayerVirtualWorld(playerid) == 3)
{
if ((!adds) && (PlayerInfo[playerid][mstrvbcAdmin] < 1))
{
format(string, sizeof(string), "Aguarda %d segundos para fazeres outro anъncio.", (addtimer/1000));
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
new payout = idx * 15;
if(GetPlayerEuros(playerid) < payout)
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:]Nгo tens dinheiro suficiente para fazeres publicidade.");
return 1;
}
GivePlayerEuros(playerid, - payout);
format(string, sizeof(string), "___________________________[Publicidade]___________________________");
SendClientMessageToAll(COLOR_LIGHTGREEN,string);
format(string, sizeof(string), "[Anъncio:] %s", result);
SendClientMessageToAll(COLOR_WHITE,string);
format(string, sizeof(string), "[Anъncio:] Publicidade por: %s - Nъmero De Telemуvel: %d.", GetPlayerNameEx(playerid),PlayerInfo[playerid][msPhoneNumber]);
SendClientMessageToAll(COLOR_WHITE,string);
SendClientMessageToAll(COLOR_LIGHTGREEN,"________________________________________________________________________________________________________________________");
if (PlayerInfo[playerid][mstrvbcAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
format(string, sizeof(string), " Caracteres contidos: %d - Preзo: %dЂ - Obrigado pelo seu anъncio.");
SendClientMessage(playerid,COLOR_WHITE,string);
PlayerActionMessage(playerid,15.0,"Deu algum dinheiro ao jornalista e fez o seu anuncio");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Nгo te encontras no Negуcio.");
}
}
}
return 1;
}
C:\Users\Jesus\Desktop\Comunidade OG\OG\pawno\include\a_players.inc(125) : warning 201: redefinition of constant/macro (symbol "MAX_PLAYER_ATTACHED_OBJECTS")
C:\Users\Jesus\Desktop\Comunidade OG\OG\pawno\include\JunkBuster.inc(1084) : warning 209: function "F_SetPlayerPos" should return a value
C:\Users\Jesus\Desktop\Comunidade OG\OG\pawno\include\JunkBuster.inc(3126) : warning 201: redefinition of constant/macro (symbol "SetPlayerPos")
C:\Users\Jesus\Desktop\Comunidade OG\OG\gamemodes\OG-RP.pwn(5307) : warning 225: unreachable code
C:\Users\Jesus\Desktop\Comunidade OG\OG\gamemodes\OG-RP.pwn(6227) : error 036: empty statement
C:\Users\Jesus\Desktop\Comunidade OG\OG\gamemodes\OG-RP.pwn(52764) : warning 203: symbol is never used: "FloodAn"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
};
(SetPlayerInterior(playerid, 3));
if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Nгo estбs logado.");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] (/an)uncio [texto]");
return 1;
}
if(!IsPlayerInRangeOfPoint(playerid, 20.0, 364.1921,168.3376,1019.9844))
{
if(GetPlayerVirtualWorld(playerid) == 3)
{
SetPlayerInterior(playerid, 3));
if ((!adds) && (PlayerInfo[playerid][mstrvbcAdmin] < 1))
{
format(string, sizeof(string), "Aguarda %d segundos para fazeres outro anъncio.", (addtimer/1000));
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
new payout = idx * 15;
if(GetPlayerEuros(playerid) < payout)
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:]Nгo tens dinheiro suficiente para fazeres publicidade.");
return 1;
}
GivePlayerEuros(playerid, - payout);
format(string, sizeof(string), "___________________________[Publicidade]___________________________");
SendClientMessageToAll(COLOR_LIGHTGREEN,string);
format(string, sizeof(string), "[Anъncio:] %s", result);
SendClientMessageToAll(COLOR_WHITE,string);
format(string, sizeof(string), "[Anъncio:] Publicidade por: %s - Nъmero De Telemуvel: %d.", GetPlayerNameEx(playerid),PlayerInfo[playerid][msPhoneNumber]);
SendClientMessageToAll(COLOR_WHITE,string);
SendClientMessageToAll(COLOR_LIGHTGREEN,"________________________________________________________________________________________________________________________");
if (PlayerInfo[playerid][mstrvbcAdmin] < 1)
{
SetTimer("AddsOn", addtimer, 0);
adds = 0;
}
format(string, sizeof(string), " Caracteres contidos: %d - Preзo: %d€ - Obrigado pelo seu anъncio.");
SendClientMessage(playerid,COLOR_WHITE,string);
PlayerActionMessage(playerid,15.0,"Deu algum dinheiro ao jornalista e fez o seu anuncio");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Nгo te encontras no Negуcio.");
}
}
}
return 1;
}