[Ajuda] Anti God by DraKoN
#1

estou compilando tudo , porem me aparece este erro :
Quote:

error 017: undefined symbol "SetPVar"

Linha do erro :
SetPVar(playerid, #comandoGd, gettime());

Code inteiro :
pawn Код:
#include <a_samp>
#include <zcmd>

#define NARANJA 0xF97804FF

new Float:GODX;
new Float:GODY;
new Float:GODZ;
new Float:ComandoGod;

CMD:god(playerid, params[])
{

    if(gettime() - GetPVar(playerid, #comandoGd) < 4) {
        return false;
    }
    SetPVar(playerid, #comandoGd,  gettime());
    new otherid = strval(params);

    if(GetDistanceBetweenPlayers(playerid, otherid) > 20) {
        return SendClientMessage(playerid,NARANJA, "[ERRO]: Jogador Longe de Mais (20mt)");
    }

    if( GetPlayerInterior(otherid) ) {
        return SendClientMessage(playerid,NARANJA,"[ERRO]: Jogaddor em interior");
    }

    if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid, NARANJA, "[ERRO]: Jogador Off");
    if(otherid == playerid) return SendClientMessage(playerid, NARANJA, "[ERRO]:Reportando a Si Mesmo?");

    GetPlayerHealth(otherid, ComandoGod);
    SetPlayerHealth(otherid, 80);
    GetPlayerPos(otherid, GODX, GODY, GODZ);
    SetPlayerPos(otherid, GODX, GODY, GODZ+20);

    SetTimerEx("CheckGod", 2000, false, "ii", playerid, otherid);
    SendClientMessage(playerid, NARANJA, "[INFO]: Aguarde 2 Segundos");
    TogglePlayerControllable(playerid, 0);
    return true;
}


//By: Slick
GetDistanceBetweenPlayers(playerid,playerid2)
{
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    new Float:dis;
    GetPlayerPos(playerid,x1,y1,z1);
    GetPlayerPos(playerid2,x2,y2,z2);
    dis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
    return floatround(dis);
}


CheckGod(health1,playerid);
public CheckGod(health1,playerid)
{
    static
        string[62+MAX_PLAYER_NAME+MAX_PLAYER_NAME]
        ;

    static Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);

    if(z != GODZ) return 0;

    static Float:health;
    GetPlayerHealth(playerid,health);

    if(health >= 80) {

        static name2[MAX_PLAYER_NAME];
        GetPlayerName(health1, name2, sizeof(name2));

        static name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));

        format(string, sizeof(string),"-AntiGod-: %s foi banido  (By: %s [/god])",name,name2);
        SendClientMessageToAll(NARANJA, string);

        Ban(playerid);
    }
    if(health < 80) {
        SendClientMessage(health1,VERMELHO,"[ERRO]: Player Nгo God,Preste Mais atencao ao  reportar [Como Puniзгo Morreras]");
        SetPlayerHealth(health1,0.0);
    }

    SetPlayerHealth(playerid, ComandoGod);
    TogglePlayerControllable(health1,1);

    return 1;
}
Reply
#2

Mude por SetPVarInt
Reply
#3

Quote:
Originally Posted by PT
Посмотреть сообщение
Mude por SetPVarInt
Resolver meu problema obrigado + rep

PT agora tenho outro problema , quando eu digito /pgod ele aparece a mensagem de quando eu . Ex : reporto eu mesmo , e quando digito ex : /pgod 1 , aparece a mensagem de quando o jogador esta longe . como resolvo isso ?
Reply
#4

Quote:
Originally Posted by Patrick141
Посмотреть сообщение
Resolver meu problema obrigado + rep

PT agora tenho outro problema , quando eu digito /pgod ele aparece a mensagem de quando eu . Ex : reporto eu mesmo , e quando digito ex : /pgod 1 , aparece a mensagem de quando o jogador esta longe . como resolvo isso ?
Use sscanf para fazer o comando com parametros ou isnull
Reply
#5

Quote:
Originally Posted by PT
Посмотреть сообщение
Use sscanf para fazer o comando com parametros ou isnull
Nao entendo muito de sscanf...... seria + ou - assim ?
pawn Код:
CMD:pgod(playerid,params[])
{
new Msg[128], pgod;
if (sscanf(params, "i", pgod))return SendClientMessage(playerid, Amarelo, "Use: /Pgod [ID]");
else
{
.......
??
Reply
#6

sim, mas a variavel ta com o G minusculo.
Reply
#7

Quote:
Originally Posted by RiqueP
Посмотреть сообщение
sim, mas a variavel ta com o G minusculo.
Foi exemplo...... tentei criar ...... esta correto ?
pawn Код:
CMD:pgod1(playerid, params[])
{
new Msg[128], pgod;
if (sscanf(params, "i", pgod))return SendClientMessage(playerid, Amarelo, "Use: /Pgod [ID]");
else
{
if(gettime() - GetPVarInt(playerid, #comandoGd) < 4) {
SetPVarInt(playerid, #comandoGd, gettime());
return false;
}
SetPVarInt(playerid, #comandoGd, gettime());
new otherid = strval(params);
if(GetDistanceBetweenPlayers(playerid, otherid) > 20)
{
return SendClientMessage(playerid,Amarelo, "[Info]: Player too far ! (20mt)");
}
if( GetPlayerInterior(otherid) )
{
return SendClientMessage(playerid,Amarelo,"[Info]: This player is in an interior !");
}
if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid, Amarelo, "[Info]: Player Offline !");
if(otherid == playerid) return SendClientMessage(playerid, Vermelho, "[Error]: You can not report yourself !");
}else
GetPlayerHealth(otherid, ComandoGod);
SetPlayerHealth(otherid, 80);
GetPlayerPos(otherid, GODX, GODY, GODZ);
SetPlayerPos(otherid, GODX, GODY, GODZ+20);
SetTimerEx("CheckGod", 2000, false, "ii", playerid, otherid);
SendClientMessage(playerid, Amarelo, "[Info]: Wait 2 Seconds......");
TogglePlayerControllable(playerid, 0);
}
return true;
}
Reply
#8

PHP код:
CMD:god(playeridparams[])
{
    new 
otherid;
    if(
sscanf(params"u"otherid))
        return 
SendClientMessage(playerid, -1"/god <id>");
    
    if(!
IsPlayerConnected(otherid)) 
        return 
SendClientMessage(playeridNARANJA"[ERRO]: Jogador Off");
    if(
otherid == playerid
        return 
SendClientMessage(playeridNARANJA"[ERRO]:Reportando a Si Mesmo?");

    if(
GetDistanceBetweenPlayers(playeridotherid) > 20
        return 
SendClientMessage(playerid,NARANJA"[ERRO]: Jogador Longe de Mais (20mt)");
    if( 
GetPlayerInterior(otherid) ) 
        return 
SendClientMessage(playerid,NARANJA,"[ERRO]: Jogaddor em interior");

    
GetPlayerHealth(otheridComandoGod);
    
SetPlayerHealth(otherid80);
    
GetPlayerPos(otheridGODXGODYGODZ);
    
SetPlayerPos(otheridGODXGODYGODZ+20);

    
SetTimerEx("CheckGod"2000false"ii"playeridotherid);
    
SendClientMessage(playeridNARANJA"[INFO]: Aguarde 2 Segundos");
    
TogglePlayerControllable(playerid0);
    return 
true;

Reply
#9

Uma dica, nгo usa esse ai nгo, й muito antigo pode nгo funcionar
Reply
#10

Quote:
Originally Posted by StarPeens
Посмотреть сообщение
Uma dica, nгo usa esse ai nгo, й muito antigo pode nгo funcionar
Caso ele precise de outro eu uso esse aqui e infalнvel pro sorvete https://sampforum.blast.hk/showthread.php?tid=419689
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)