Can someone put this together please?
#1

Hi, can someone please put these commands together for me? please, i dont know how to do it, and i would be grateful if you could plzzz

Put:
{
//This will start your engine!
if(strcmp(cmd, "/lightsonn",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
// ||||||
SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,al arm,doors,bonnet,boot,objective);
//VEHICLE_PARAMS_ON is used to turn onn the lights.
}
return 1;
}
if(strcmp(cmd, "/lightsoff",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
// ||||||
SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,a larm,doors,bonnet,boot,objective);
//Here the VEHICLE_PARAMS_OFF will turn off your lights.
}
return 1;
}

if(strcmp(cmd, "/turnonobjective",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,VEHICLE_PARAMS_ON);

}
return 1;
}
if(strcmp(cmd, "/turnoffobjective",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,VEHICLE_PARAMS_OFF);
}
return 1;
}


if(strcmp(cmd, "/opendoors",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,VEHICLE _PARAMS_ON,bonnet,boot,objective);

}
return 1;
}
if(strcmp(cmd, "/closedoors",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,VEHICLE _PARAMS_OFF,bonnet,boot,objective);
}
return 1;
}

if(strcmp(cmd, "/alarmon",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAM S_ON,doors,bonnet,boot,objective);

}
return 1;
}
if(strcmp(cmd, "/alarmoff",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAM S_OFF,doors,bonnet,boot,objective);
}
return 1;
}

if(strcmp(cmd, "/openbonnet",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,V EHICLE_PARAMS_ON,boot,objective);

}
return 1;
}
if(strcmp(cmd, "/closebonnet",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,V EHICLE_PARAMS_OFF,boot,objective);
}
return 1;
}

if(strcmp(cmd, "/openboot",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,VEHICLE_PARAMS_ON,objective);

}
return 1;
}
if(strcmp(cmd, "/closeboot",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,VEHICLE_PARAMS_OFF,objective);
}
return 1;
}




Into this:

{
if(strcmp(cmdtext, "/startengine",true) == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,al arm,doors,bonnet,boot,objective);
}
return 1;
}


if(strcmp(cmdtext, "/stopengine",true) == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,a larm,doors,bonnet,boot,objective);
}
return 1;
}


if(strcmp(cmdtext, "/Teleport", true) == 0)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Teleport Menu", "Unity Station \n Los Santos Police Department", "Select", "Cancel");
return 1;
}
return 0;
}
Reply
#2

I don't know what you mean. But I think you copied and pasted the wrong stuff. Or you forgot something. I cannot help you, we can all see that you did not make this. Just another copy and paste. -_-.
Reply
#3

I agree with Tee, Looks stolen/not complete.
Reply
#4

Somewhere under #defines, or under #includes
pawn Код:
new engine,lights,alarm,doors,bonnet,boot,objective;
pawn Код:
{
    if(strcmp(cmdtext, "/startengine",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/stopengine",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/Teleport", true) == 0)
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Teleport Menu", "Unity Station \n Los Santos Police Department", "Select", "Cancel");
        return 1;
    }
    if(strcmp(cmdtext, "/lightsonn",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/lightsoff",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/turnonobjective",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_ON);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/turnoffobjective",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_OFF);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/opendoors",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/closedoors",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,lights,alarm,VEHICLE_PARAMS_OFF,bonnet,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/alarmon",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/alarmoff",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/openbonnet",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/closebonnet",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/openboot",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/closeboot",true) == 0)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
        }
        return 1;
    }
    return 0;
}
Reply
#5

Thanks antonio, u other guys are ovviously thick as shit and dont understand what i meant. I coped that stuff directly from my script except i dont know how to put it together as one without getting an error.

Anyways thanks once again antonio
Reply
#6

Once again, I forgot to change 'cmd' with 'cmdtext'. Edited my early post, try it now.
Reply
#7

Errors:

C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(222) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(223) : error 017: undefined symbol "lights"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(232) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(233) : error 017: undefined symbol "lights"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(245) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(246) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(253) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(254) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(261) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(262) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(270) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(271) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(27 : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(279) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(287) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(28 : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(295) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(296) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(304) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(305) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(313) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(314) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(322) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(323) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(331) : error 017: undefined symbol "engine"
C:\Users\Anoop\Desktop\samp03csvr_R2-2_win32\gamemodes\Server.pwn(332) : error 017: undefined symbol "engine"
Reply
#8

Create global variables for 'engine' and 'lights'

Above OnPlayerCommandText:

pawn Код:
new engine, lights;
Reply
#9

still dun work
Reply
#10

There`s now way it can`t work ... use
pawn Код:
new engine,lights,alarm,doors,bonnet,boot,objective;
Right under all your #include
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)