SA-MP Forums Archive
1 warning while compiling - 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: 1 warning while compiling (/showthread.php?tid=608686)



1 warning while compiling - hardiksingh5 - 04.06.2016

PHP код:
C:\Users\Dell pc\Desktop\My First Gamemode\gamemodes\PilotSa.pwn(5956) : warning 217loose indentation
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
Header size
:           6816 bytes
Code size
:          1413552 bytes
Data size
:          1904468 bytes
Stack
/heap size:      16384 bytesestimated maxusageunknowndue to recursion
Total requirements
3341220 bytes
1 Warning

how to fix this please help me

PHP код:
    if(strcmp(cmd"/createhouse"true) == 0)
    {
        if(!
strcmp(PlayerName(playerid), "Hardik"))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_ERROR"Syntax: /createhouse (price) (interior[1-10]) (slots)");
                return 
1;
            }
            new 
price;            //stock AddHouse(playerid, price, interior, slots)
            
price strvalEx(tmp);
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_ERROR"Syntax: /createhouse (price) (interior[1-10]) (slots)");
                return 
1;
            }
            new 
interior;
            
interior strvalEx(tmp);
            if(
interior || interior 10) { SendClientMessage(playeridCOLOR_ERROR"Interior ID's are 1-10."); return 1; }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_ERROR"Syntax: /createhouse (price) (interior[1-10]) (slots)");
                return 
1;
            }
            new 
slots;
            
slots strvalEx(tmp);
            if(
slots 50) { SendClientMessage(playeridCOLOR_ERROR"Maximum slots for a house is 50."); return 1; }
            
AddHouse(playeridpriceinteriorslots);
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridCOLOR_ERROR"Developer's only!");
            return 
1;
        }
    } 
this is the whole command


Re: 1 warning while compiling - hardiksingh5 - 04.06.2016

if(strcmp(cmd, "/createhouse", true) == 0)
{
if(!strcmp(PlayerName(playerid), "Hardik"))
{
one more help this is a developers command so developers name is hardik in this but how can i add more than 1 developer in the command


Re: 1 warning while compiling - WhiteGhost - 04.06.2016

https://sampwiki.blast.hk/wiki/Errors_List

Just Line up your code
Example:
PHP код:
if(IsPlayerAdmin(playerid))return SendClientMessage(playerid,-1,"Your An Admin!");
              if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Your Not An Admin!"); 
Should be Like:
PHP код:
if(IsPlayerAdmin(playerid))return SendClientMessage(playerid,-1,"Your An Admin!");
if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Your Not An Admin!"); 
Edit: Like
PHP код:
#include <zcmd>
CMD:developers(playerid,params[])
{
SendClientMessage(playerid,-1,"Hadik");
return 
1;




Re: 1 warning while compiling - hardiksingh5 - 04.06.2016

no i mean i am developer hardik so i can only use this command but how can i add more players so they can also use this cmd


Re: 1 warning while compiling - Stinged - 04.06.2016

It's probably better to use admin levels, but:
Код:
if(!strcmp(PlayerName(playerid), "Hardik") || !strcmp(PlayerName(playerid), "Name"))