[Ajuda] ajuda a por distancia ????
#1

Boa tarde galera , eu estou com um probleminha aqui ... estou tentando por distancias no meu sv , em comandos como ::

Quote:

CMD:ningendou(playerid, params[])//ningendou
{
new plid;
if(PlayerDados[playerid][Akatsuki] < 2) return SendClientMessage(playerid, BRANCO, "Vocк possui esse jutsu");
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, CINZA, " Use /ningendou [ID]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, BRANCO, "[ERRO] ID invalido");
if(GetDistanceBetweenPlayers(plid,playerid) < 15){
if(GetProgressBarValue(chakra[playerid]) < 400) return SendClientMessage(playerid, 0x00F6F6AA,"Vocк nгo tem chakra suficiente");
new Float:h;
h = GetProgressBarValue(chakra[playerid]);
SetProgressBarValue(chakra[playerid],h-400);
UpdateProgressBar(chakra[playerid], playerid);
SetPlayerHealth(ID, 0.1);
format(String, sizeof(String), "%s !! NIGENDХ !! %s", Nome(playerid), Nome(ID));
SendClientMessageToAll(AZUL, String);
} else {
SendClientMessage(playerid,VERMELHO," Chegue mais perto para usar esse jutsu");
return 1;
}
return 1;
}

hб algo errado ai , pois eu uso ele numa distancia maior da q se pede ::
Quote:

if(GetDistanceBetweenPlayers(plid,playerid) < 15){

e funciona , alguem sabe como ajeitar??

caso isso ajude :

Quote:

stock GetDistanceBetweenPlayers(player1, player2)
{
new Float1x, Float2x, Float1y, Float2y, Float1z, Float2z;
GetPlayerPos(player1, p1x, p1y, p1z);
GetPlayerPos(player2, p2x, p2y, p2z);
new dist = floatsqroot((floatpower((p2x - p1x), 2) + floatpower((p2y - p1y), 2) + floatpower((p2z - p1z), 2)));
return dist;
}

Por favor tentem me ajudar ...
Reply
#2

https://sampwiki.blast.hk/wiki/Useful_Fu...BetweenPlayers
Reply
#3

Quote:
Originally Posted by ProKillerpa
Посмотреть сообщение
obrigado mais eu sou scripter super iniciante ,e n sei mecher mto com pawno rsrs , voce pode me ajudar?
Reply
#4

PHP код:
if(GetDistanceBetweenPlayers(playeridi) <= 15
Reply
#5

Quote:
Originally Posted by ProKillerpa
Посмотреть сообщение
PHP код:
if(GetDistanceBetweenPlayers(playeridi) <= 15
ok obrigado , add skype?
Reply
#6

Quote:
Originally Posted by ProKillerpa
Посмотреть сообщение
PHP код:
if(GetDistanceBetweenPlayers(playeridi) <= 15
Quote:

C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(691 : error 017: undefined symbol "i"
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(6914) : warning 203: symbol is never used: "plid"
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(6914 -- 6927) : warning 209: function "cmd_ningendou" should return a value
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(6914 -- 6927) : error 010: invalid function or declaration
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(6914 -- 6929) : error 010: invalid function or declaration
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(6914 -- 6929) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

agora deu isso..
Reply
#7

Bom amigo, й necessбrio que vocк estude ao menos o bбsico sobre variбveis antes de comeзar a editar um GM. Tudo bem, editar um GM й buscar conhecimento para novatos, mas vocк precisa ao menos saber o bбsico para comeзar a mexer com isso.

Retire

PHP код:
new plid
Porfavor, poste o resto do comando, nгo posso adivinhar oque vocк fez de errado;
Reply
#8

Quote:
Originally Posted by ProKillerpa
Посмотреть сообщение
Bom amigo, й necessбrio que vocк estude ao menos o bбsico sobre variбveis antes de comeзar a editar um GM. Tudo bem, editar um GM й buscar conhecimento para novatos, mas vocк precisa ao menos saber o bбsico para comeзar a mexer com isso.

Retire

PHP код:
new plid
Porfavor, poste o resto do comando, nгo posso adivinhar oque vocк fez de errado;
erros :

Quote:

C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(6917) : error 017: undefined symbol "i"
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(6926) : warning 209: function "cmd_ningendou" should return a value
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(6926) : error 010: invalid function or declaration
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(692 : error 010: invalid function or declaration
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(6930) : error 010: invalid function or declaration
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(10104) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(10104) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(1054 : warning 213: tag mismatch
C:\Users\Projeto NSG\Desktop\GM - Samp Naruto\NESX1\Back\NESX.pwn(1055 : warning 203: symbol is never used: "TimerKit"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

comando :

Quote:

CMD:ningendou(playerid, params[])//ningendou
{
if(PlayerDados[playerid][Akatsuki] < 2) return SendClientMessage(playerid, BRANCO, "Vocк possui esse jutsu");
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, CINZA, " Use /ningendou [ID]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, BRANCO, "[ERRO] ID invalido");
if(GetDistanceBetweenPlayers(playerid, i) <= 15)
if(GetProgressBarValue(chakra[playerid]) < 400) return SendClientMessage(playerid, 0x00F6F6AA,"Vocк nгo tem chakra suficiente");
new Float:h;
h = GetProgressBarValue(chakra[playerid]);
SetProgressBarValue(chakra[playerid],h-400);
UpdateProgressBar(chakra[playerid], playerid);
SetPlayerHealth(ID, 0.1);
format(String, sizeof(String), "%s !! NIGENDХ !! %s", Nome(playerid), Nome(ID));
SendClientMessageToAll(AZUL, String);
} else {
SendClientMessage(playerid,VERMELHO," Chegue mais perto para usar esse jutsu");
return 1;
}
return 1;
}

Reply
#9

use a identaзгo fica feio script sem identacao

pawn Код:
CMD:ningendou(playerid, params[])//ningendou
{
    if(PlayerDados[playerid][Akatsuki] < 2)
        return SendClientMessage(playerid, BRANCO, "Vocк possui esse jutsu");
    if(sscanf(params, "u", params[0]))
        return SendClientMessage(playerid, CINZA, " Use /ningendou [ID]");
    if(!IsPlayerConnected(params[0]))
        return SendClientMessage(playerid, BRANCO, "[ERRO] ID invalido");
    if(GetDistanceBetweenPlayers(playerid, params[0]) > 15)
        return SendClientMessage(playerid,VERMELHO," Chegue mais perto para usar esse jutsu");
    if(GetProgressBarValue(chakra[playerid]) < 400)
        return SendClientMessage(playerid, 0x00F6F6AA,"Vocк nгo tem chakra suficiente");
    new Float:h = GetProgressBarValue(chakra[playerid]);
    SetProgressBarValue(chakra[playerid],h-400);
    UpdateProgressBar(chakra[playerid], playerid);
    SetPlayerHealth(params[0], 0.1);
    format(String, sizeof(String), "%s !! NIGENDХ !! %s", Nome(playerid), Nome(params[0]));
    SendClientMessageToAll(AZUL, String);
    return 1;
}
Reply
#10

Quote:
Originally Posted by PT
Посмотреть сообщение
use a identaзгo fica feio script sem identacao

pawn Код:
CMD:ningendou(playerid, params[])//ningendou
{
    if(PlayerDados[playerid][Akatsuki] < 2)
        return SendClientMessage(playerid, BRANCO, "Vocк possui esse jutsu");
    if(sscanf(params, "u", params[0]))
        return SendClientMessage(playerid, CINZA, " Use /ningendou [ID]");
    if(!IsPlayerConnected(params[0]))
        return SendClientMessage(playerid, BRANCO, "[ERRO] ID invalido");
    if(GetDistanceBetweenPlayers(playerid, params[0]) > 15)
        return SendClientMessage(playerid,VERMELHO," Chegue mais perto para usar esse jutsu");
    if(GetProgressBarValue(chakra[playerid]) < 400)
        return SendClientMessage(playerid, 0x00F6F6AA,"Vocк nгo tem chakra suficiente");
    new Float:h = GetProgressBarValue(chakra[playerid]);
    SetProgressBarValue(chakra[playerid],h-400);
    UpdateProgressBar(chakra[playerid], playerid);
    SetPlayerHealth(params[0], 0.1);
    format(String, sizeof(String), "%s !! NIGENDХ !! %s", Nome(playerid), Nome(params[0]));
    SendClientMessageToAll(AZUL, String);
    return 1;
}
Obrigado :3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)