cmds problem help rep+
#1

Here the problem

Код:
C:\Users\Home\Desktop\Redemption Roleplay v1.0\gamemodes\RMRP.pwn(34387) : warning 217: loose indentation
cmd
Код:
CMD:eon(playerid, params[])
{
		new giveplayerid;
        new string[128];
		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)
		{
			SetVehicleEngine(vehicleid, playerid);
			format(string, sizeof(string), "* %s spins a key and turn the vehicle engine off to %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
		{
		    format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SendClientMessageEx(playerid, TEAM_GROVE_COLOR, "Vehicle engine starting");
			SetTimerEx("SetVehicleEngine", 1000, 0, "dd",  vehicleid, playerid);
	}
	return 1;
Reply
#2

loose warnings are ok sometimes they happen and the command still works and things i get alot of loose warnings but everthing all ways works fine.
Reply
#3

That's just because your formatting is horrible.

pawn Код:
if(x=y)
{
  SendClientMessage(playerid, COLOR_GREY, "hello");
  return 1;
  }
Fix ^that style of formatting into this

pawn Код:
if(x=y)
{
    SendClientMessage(playerid, COLOR_GREY, "hello");
    return 1;
}
Reply
#4

I like how all your help threads have the same title. Creative

Here's a fixed version:

pawn Код:
CMD:eon(playerid, params[])
{
    new
        giveplayerid,
        string[128],
        engine,
        lights,
        alarm,
        doors,
        bonnet,
        boot,
        objective,
        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)
    {
        SetVehicleEngine(vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and turn the vehicle engine off to %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
    {
        format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        SendClientMessageEx(playerid, TEAM_GROVE_COLOR, "Vehicle engine starting");
        SetTimerEx("SetVehicleEngine", 1000, 0, "dd",  vehicleid, playerid);
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Rob_Maate
Посмотреть сообщение
That's just because your formatting is horrible.

pawn Код:
if(x=y)
{
  SendClientMessage(playerid, COLOR_GREY, "hello");
  return 1;
  }
Fix ^that style of formatting into this

pawn Код:
if(x=y)
{
    SendClientMessage(playerid, COLOR_GREY, "hello");
    return 1;
}
Thanks now is fixed +rep

thanks to Emmet_ too
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)