command wont work
#1

why wont this work


Код:
	if(strcmp(cmd, "/car", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new x_nr[32];
			x_nr = strtok(cmdtext, idx);
			if(!strlen(x_nr)) {
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /car [name]");
		  		SendClientMessage(playerid, COLOR_GRAD1, "Available names: engine, lights, trunk, status, fuel");
				return 1;
			}
			else if(strcmp(x_nr,"lights",true) == 0)
			{
    			new vid = GetPlayerVehicleID(playerid);
                GetVehicleParamsEx(vid ,engine,lights,alarm,doors,bonnet,boot,objective);
                if (lights==1)
                {
					SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
                }
                else
                {
                    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
                }
                return 1;
            }

sorry how it looks it all ways copy over to samp forum shit
Reply
#2

Post the error if you want us to help you ..
Reply
#3

Quote:
Originally Posted by ToPhrESH
Посмотреть сообщение
Post the error if you want us to help you ..
there no error it just wont trun on the lights
Reply
#4

pawn Код:
if(strcmp(params, "Lights", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(LightsStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {2F991A}on!");
                }
                else if(LightsStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {E31919}off!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
        }
    }
basic for lights, change to your likings
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)