SA-MP Forums Archive
pickup - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: pickup (/showthread.php?tid=634742)



error script - asri - 25.05.2017

i have this script

PHP код:
CMD:cvwkxam(playeridparams[])
{
   for(new 
0;i<MAX_PLAYERS;i++)
   {
    if(
IsPlayerConnected(i))
    {
        new 
Float:pos[3], Float:pHealthFLOAT;
        
GetPlayerPos(ipos[0], pos[1], pos[2]);
        
SendClientMessage(playerid,COLOR_WATERRR,"Cheat Activated!");
        if (
UnderWater[i]==0){
        if (
pos[2]<-2.0){
        
GetPlayerHealth(i,pHealthFLOAT);
        
pOxygenGlobal[i]=floatround(pHealthFLOATfloatround_tozero);
        
UnderWater[i]=1;
        
SendClientMessage(iCOLOR_WATERRR"You are underwater!");
    }
    else if (
UnderWater[i]==1)
    {
        if (
pos[2]>=0.0)
        {
          new 
Float:pHealthFLOATOUT;
             
pHealthFLOATOUT float(pOxygenGlobal[i]);
          
SetPlayerHealth(i,pHealthFLOATOUT);
          
UnderWater[i]=0;
          
SendClientMessage(iCOLOR_WATERRR"You are no longer underwater!");
        }
        else 
SetPlayerHealth(i,1000.0);
     }
   }
   return 
1;

i dont how to fix that

it give this
Quote:

H:\gta server cc bukit\gamemodes\GM.pwn(1241) : warning 217: loose indentation
H:\gta server cc bukit\gamemodes\GM.pwn(1255) : warning 217: loose indentation
H:\gta server cc bukit\gamemodes\GM.pwn(1261) : error 030: compound statement not closed at the end of file (started at line 122
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.




Re: pickup - xeon_inside - 25.05.2017

you have opened a { but never closed it }


Re: pickup - rolex - 25.05.2017

Try it:

PHP код:
CMD:cvwkxam(playeridparams[])
{
   for(new 
0;i<MAX_PLAYERS;i++)
   {
        if(
IsPlayerConnected(i))
        {
            new 
Float:pos[3], Float:pHealthFLOAT;

            
GetPlayerPos(ipos[0], pos[1], pos[2]);
            
SendClientMessage(playerid,COLOR_WATERRR,"Cheat Activated!");
            if (
UnderWater[i]==0){
            if (
pos[2]<-2.0){
            
GetPlayerHealth(i,pHealthFLOAT);
            
pOxygenGlobal[i]=floatround(pHealthFLOATfloatround_tozero);
            
UnderWater[i]=1;
            
SendClientMessage(iCOLOR_WATERRR"You are underwater!");
        }
        else if (
UnderWater[i]==1)
        {
            if (
pos[2]>=0.0)
            {
                  new 
Float:pHealthFLOATOUT;
                
pHealthFLOATOUT float(pOxygenGlobal[i]);
                  
SetPlayerHealth(i,pHealthFLOATOUT);
                  
UnderWater[i]=0;
                  
SendClientMessage(iCOLOR_WATERRR"You are no longer underwater!");
             }
        }
        else 
SetPlayerHealth(i,1000.0);
   }
   return 
1;




Re: pickup - asri - 26.05.2017

Quote:

C:\Users\cyber\Desktop\pawn sublime\yay\GM.pwn(3454) : error 030: compound statement not closed at the end of file (started at line 3424)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

PHP код:
CMD:cvwkxam(playeridparams[])
{
   for(new 
0;i<MAX_PLAYERS;i++)
   {
        if(
IsPlayerConnected(i)) <<< the error line
        
{
            new 
Float:pos[3], Float:pHealthFLOAT;
            
GetPlayerPos(ipos[0], pos[1], pos[2]);
            
SendClientMessage(playerid,COLOR_WATERRR,"Cheat Activated!");
            if (
UnderWater[i]==0){
            if (
pos[2]<-2.0){
            
GetPlayerHealth(i,pHealthFLOAT);
            
pOxygenGlobal[i]=floatround(pHealthFLOATfloatround_tozero);
            
UnderWater[i]=1;
            
SendClientMessage(iCOLOR_WATERRR"You are underwater!");
        }
        else if (
UnderWater[i]==1)
        {
            if (
pos[2]>=0.0)
            {
                  new 
Float:pHealthFLOATOUT;
                  
pHealthFLOATOUT float(pOxygenGlobal[i]);
                  
SetPlayerHealth(i,pHealthFLOATOUT);
                  
UnderWater[i]=0;
                  
SendClientMessage(iCOLOR_WATERRR"You are no longer underwater!");
             }
        }
        else 
SetPlayerHealth(i,1000.0);
   }
   return 
1;




Re: pickup - asri - 26.05.2017

anyone


Re: pickup - Aldrago - 26.05.2017

Which statement is giving error


Re: pickup - Aldrago - 26.05.2017

In last statement there is close bracket have one extra space 1st press back and then tab on } this


Re: pickup - asri - 26.05.2017

where can you show the line code or bracket


Re: pickup - asri - 26.05.2017

of error


Re: pickup - StrikerZ - 26.05.2017

PHP код:
CMD:cvwkxam(playeridparams[])
{
   for(new 
0;i<MAX_PLAYERS;i++)
   {
        if(
IsPlayerConnected(i))
        {
            new 
Float:pos[3], Float:pHealthFLOAT;

            
GetPlayerPos(ipos[0], pos[1], pos[2]);
            
SendClientMessage(playerid,COLOR_WATERRR,"Cheat Activated!");
            if (
UnderWater[i]==0)
            {
                if (
pos[2]<-2.0)
                {
                    
GetPlayerHealth(i,pHealthFLOAT);
                    
pOxygenGlobal[i]=floatround(pHealthFLOATfloatround_tozero);
                    
UnderWater[i]=1;
                    
SendClientMessage(iCOLOR_WATERRR"You are underwater!");
                }
            }
            else if (
UnderWater[i]==1)
            {
                if (
pos[2]>=0.0)
                {
                  new 
Float:pHealthFLOATOUT;
                  
pHealthFLOATOUT float(pOxygenGlobal[i]);
                  
SetPlayerHealth(i,pHealthFLOATOUT);
                  
UnderWater[i]=0;
                  
SendClientMessage(iCOLOR_WATERRR"You are no longer underwater!");
                }
                else 
SetPlayerHealth(i,1000.0);
            }
        }
   }
   return 
1;