SA-MP Forums Archive
cmds problem help rep+ - 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: cmds problem help rep+ (/showthread.php?tid=302600)



cmds problem help rep+ - N0FeaR - 09.12.2011

Here the warning i get
Код:
C:\Users\rцva\Desktop\basesricpt\gamemodes\Testsricpt.pwn(33516) : warning 217: loose indentation
Here is the cmd
Код:
}
CMD:engine(playerid, paramas[])
{
   if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
   {
		new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
		vehicleid = GetPlayerVehicleID(playerid);
		if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
		GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
		if(engine == VEHICLE_PARAMS_ON)
		{
            new sendername[MAX_PLAYER_NAME];
            new string[128];
			SetVehicleEngine(vehicleid, playerid);
			format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
	}
	return 1;
}



Re: cmds problem help rep+ - iTorran - 09.12.2011

You need to indent your code
http://pastebin.com/U2W4HNTU


Re: cmds problem help rep+ - grand.Theft.Otto - 09.12.2011

Try this:

pawn Код:
CMD:engine(playerid, paramas[])
{
   if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
   {
        new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
        vehicleid = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(engine == VEHICLE_PARAMS_ON)
        {
            new sendername[MAX_PLAYER_NAME];
            new string[128];
            SetVehicleEngine(vehicleid, playerid);
            format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
    }
    return 1;
}
Edit: Too late


Re: cmds problem help rep+ - Kaperstone - 09.12.2011

you need to make it straight.
Ex:
Bad:(will give you this warning)
pawn Код:
OnPlayerConntect()
{
      SendClientMessage(playerid,COLOR_YELLOW,"Text1");
          SendClientMessage(playerid,COLOR_YELLOW,"Text2");
      return 1;
}
Good:(will not give you this warning)
pawn Код:
OnPlayerConntect()
{
      SendClientMessage(playerid,COLOR_YELLOW,"Text1");
      SendClientMessage(playerid,COLOR_YELLOW,"Text2");
      return 1;
}



Re: cmds problem help rep+ - N0FeaR - 09.12.2011

Thanks guys both get rep for this


Re: cmds problem help rep+ - Kaperstone - 09.12.2011

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
Thanks guys both get rep for this
both? lol


Re: cmds problem help rep+ - Kaperstone - 09.12.2011

(sorry for double posting)
what with me? >.< lol


Re: cmds problem help rep+ - N0FeaR - 09.12.2011

Quote:
Originally Posted by xkirill
Посмотреть сообщение
(sorry for double posting)
what with me? >.< lol
you dont help me with the command xD lol


Re: cmds problem help rep+ - Kaperstone - 09.12.2011

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
you dont help me with the command xD lol
scroll up and you will i did


Re: cmds problem help rep+ - N0FeaR - 09.12.2011

well so you use this when you get warning SendClientMessage(playerid,COLOR_YELLOW,"Text1");
SendClientMessage(playerid,COLOR_YELLOW,"Text2");? that sounds wrong lol xD