SA-MP Forums Archive
[Ajuda] [AJUDA] Sistema God Mode - Erros - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] [AJUDA] Sistema God Mode - Erros (/showthread.php?tid=418463)



[AJUDA] Sistema God Mode - Erros [PAWN] - [Dark]Danny_Uchiha - 24.02.2013

Olб queria que alguem pudeзe arrumar esse sistema que eu fiz Pra Ligar e Desligar o God Mode. mais ta com erro. valeu

Quote:
//#define FILTERSCRIPT

#include <a_samp>
new bool:GodMode[MAX_PLAYERS];
new Float:hpantes;
forward GodModeFunc();
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Imortalidade para Hidan");
print("--------------------------------------\n");
SetTimer("GodModeFunc",1000,1);
return 1;
}
public OnPlayerConnect(playerid)
{
GodMode[playerid] = false;
}
public OnFilterScriptExit()
{
print("\n--------------------------------------");
print(" Fim do sistema Imortal");
print("--------------------------------------\n");
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/hidanimortalmode", cmdtext, true, 10) == 0)
{
if(GodMode[playerid] == false)
{
GetPlayerHealth(playerid,hpantes);
SetPlayerHealth(playerid,9999999);
GodMode[playerid] = true;
SendClientMessage(playerid,-1,"IMORTALIDADE {21DD00}LIGADO");
}
else
{
SetPlayerHealth(playerid,hpantes);
GodMode[playerid] = false;
SendClientMessage(playerid,-1,"IMORTALIDADE{E60000}DESLIGADO");
}
return 0;
}
public GodModeFunc()
{
for(new i;i < MAX_PLAYERS; i++)
{
else if(GodMode[i] == true)
{
SetPlayerHealth(i,9999999);
}
}
return 1;
}

Erros:

C:\Documents and Settings\Daniel\Desktop\samp03x_svr_R1-2_win32\filterscripts\HidanGodMode.pwn(46) : warning 217: loose indentation
C:\Documents and Settings\Daniel\Desktop\samp03x_svr_R1-2_win32\filterscripts\HidanGodMode.pwn(46) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Daniel\Desktop\samp03x_svr_R1-2_win32\filterscripts\HidanGodMode.pwn(46) : error 004: function "GodModeFunc" is not implemented
C:\Documents and Settings\Daniel\Desktop\samp03x_svr_R1-2_win32\filterscripts\HidanGodMode.pwn(50) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Daniel\Desktop\samp03x_svr_R1-2_win32\filterscripts\HidanGodMode.pwn(50) : warning 215: expression has no effect
C:\Documents and Settings\Daniel\Desktop\samp03x_svr_R1-2_win32\filterscripts\HidanGodMode.pwn(50) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\Daniel\Desktop\samp03x_svr_R1-2_win32\filterscripts\HidanGodMode.pwn(57) : error 030: compound statement not closed at the end of file (started at line 29)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.



Respuesta: [AJUDA] Sistema God Mode - Erros - [JD]BlackFire - 24.02.2013

Meu Deus, usa a tag [ pawn]


Re: [AJUDA] Sistema God Mode - Erros - silenthill - 24.02.2013

Tente
pawn Код:
//#define FILTERSCRIPT

#include <a_samp>
new bool:GodMode[MAX_PLAYERS];
new Float:hpantes;
forward GodModeFunc();
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Imortalidade para Hidan");
print("--------------------------------------\n");
SetTimer("GodModeFunc",1000,1);
return 1;
}
public OnPlayerConnect(playerid)
{
GodMode[playerid] = false;
}
public OnFilterScriptExit()
{
print("\n--------------------------------------");
print(" Fim do sistema Imortal");
print("--------------------------------------\n");
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/hidanimortalmode", cmdtext, true, 10) == 0)
{
if(GodMode[playerid] == false)
{
GetPlayerHealth(playerid,hpantes);
SetPlayerHealth(playerid,9999999);
GodMode[playerid] = true;
SendClientMessage(playerid,-1,"IMORTALIDADE {21DD00}LIGADO");
}
else
{
SetPlayerHealth(playerid,hpantes);
GodMode[playerid] = false;
SendClientMessage(playerid,-1,"IMORTALIDADE{E60000}DESLIGADO");
}
return 0;
}

for(new i;i < MAX_PLAYERS; i++)
{
if(GodMode[i] == true)
{
SetPlayerHealth(i,9999999);
}
}
return 1;
}



Re: [AJUDA] Sistema God Mode - Erros - Blix - 24.02.2013

pawn Код:
#include <a_samp>

new bool:GodMode[MAX_PLAYERS];
new Float:hpantes;

forward GodModeFunc();

public OnFilterScriptInit(){SetTimer("GodModeFunc",1000,1);return 1;}
public OnPlayerConnect(playerid){GodMode[playerid] = false;}
public OnFilterScriptExit(){return 1;}



public OnPlayerCommandText(playerid, cmdtext[]){
    if (strcmp("/hidanimortalmode", cmdtext, true, 17) == 0){
        if(GodMode[playerid] == false){
            GetPlayerHealth(playerid,hpantes);
            SetPlayerHealth(playerid,9999999);
            GodMode[playerid] = true;
            SendClientMessage(playerid,-1,"IMORTALIDADE {21DD00}LIGADO");
        }
        else
        {
            SetPlayerHealth(playerid,hpantes);
            GodMode[playerid] = false;
            SendClientMessage(playerid,-1,"IMORTALIDADE{E60000}DESLIGADO");
        }
        return true;
    }
    return 0;
}
public GodModeFunc(){
    for(new i;i < MAX_PLAYERS; i++){
        if(GodMode[i] == true){
            SetPlayerHealth(i,9999999);
        }
    }
    return 1;
}