SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   Help me (https://forum.sa-mp.com/showthread.php?t=630946)

Langky 20/03/2017 04:19 PM

Help me
 
LuxAdmin.pwn(5621) : warning 217: loose indentation
PHP Code:

#pragma unused params
        
new Counti;
          new 
string[128];
        new 
adminname[MAX_PLAYER_NAME];
        
SendClientMessage(playeridgreen" ");
         
SendClientMessage(playeridgreen"_________ |- Online Vip Member -| _________");
        
SendClientMessage(playeridgreen" ");
          for(
0MAX_PLAYERSi++)
        if(
IsPlayerConnected(i) && AccInfo[i][pVip] > 0)
        
Count++;

        for(
0MAX_PLAYERSi++)
            if(
IsPlayerConnected(i) && AccInfo[i][pVip] > 0)
            {
                if(
AccInfo[i][pVip] > 0)
                {
                    switch(
AccInfo[i][pVip])
                    {
                    case 
1AccType "Silver";
                    case 
2AccType "Gold";
                    case 
3AccType "Premium";
                    }
                }
                 
GetPlayerName(iadminnamesizeof(adminname));
                {
                    
format(stringsizeof(string), "%s (Id:%i) | %s",PlayerName2(i),i,AccType);
                    
SendClientMessage(playerid,yellow,string);
                }
            }
                if(
Count == 0)
            return 
SendClientMessage(playerid,red"No players have VIP Account!");
            
SendClientMessage(playeridgreen" _______________________________________");
            return 
1;



Mencent 20/03/2017 04:23 PM

Re: Help me
 
Hello!

You get this warning when you have something like this:
PHP Code:

SendClientMessage(playerid,-1,"This is a test message.");
      return 
1

This is wrong.

PHP Code:

SendClientMessage(playerid,-1,"This is a test message.");
return 
1

That's correct.

Try to find this mistake.

RyderX 20/03/2017 04:25 PM

Re: Help me
 
Here you go
PHP Code:

#pragma unused params 
        
new Counti
        new 
string[128]; 
        new 
adminname[MAX_PLAYER_NAME]; 
        
SendClientMessage(playeridgreen" "); 
        
SendClientMessage(playeridgreen"_________ |- Online Vip Member -| _________"); 
        
SendClientMessage(playeridgreen" "); 
        for(
0MAX_PLAYERSi++) 
        if(
IsPlayerConnected(i) && AccInfo[i][pVip] > 0
        
Count++; 

        for(
0MAX_PLAYERSi++) 
            if(
IsPlayerConnected(i) && AccInfo[i][pVip] > 0
            { 
                if(
AccInfo[i][pVip] > 0
                { 
                    switch(
AccInfo[i][pVip]) 
                    { 
                    case 
1AccType "Silver"
                    case 
2AccType "Gold"
                    case 
3AccType "Premium"
                    } 
                } 
                 
GetPlayerName(iadminnamesizeof(adminname)); 
                { 
                    
format(stringsizeof(string), "%s (Id:%i) | %s",PlayerName2(i),i,AccType); 
                    
SendClientMessage(playerid,yellow,string); 
                } 
            } 
            if(
Count == 0
            return 
SendClientMessage(playerid,red"No players have VIP Account!"); 
            
SendClientMessage(playeridgreen" _______________________________________"); 
            return 
1




All times are GMT. The time now is 01:26 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.