SA-MP Forums Archive
Lock Vehicles by more than one skin - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Lock Vehicles by more than one skin (/showthread.php?tid=184271)



Lock Vehicles by more than one skin - [SCRP]Cody - 19.10.2010

I'm having a problem with a script that I'm making dealing with the vehicle locks by skin. It would be fine, but I need to unlock them by more than one skin.

The errors I'm getting
Код:
C:\Users\Cody\Downloads\samp_editor\superior.pwn(374) : error 022: must be lvalue (non-constant)
C:\Users\Cody\Downloads\samp_editor\superior.pwn(374) : error 029: invalid expression, assumed zero
C:\Users\Cody\Downloads\samp_editor\superior.pwn(374) : error 022: must be lvalue (non-constant)
C:\Users\Cody\Downloads\samp_editor\superior.pwn(374) : fatal error 107: too many error messages on one line
The vehicles
Код:
    AddStaticVehicleEx(416,694.76531982,1826.11572266,5.60975170,350.07501221,-1,3,900); //Ambulance
    AddStaticVehicleEx(416,690.32727051,1826.86010742,5.60975170,350.07385254,-1,3,900); //Ambulance
    AddStaticVehicleEx(416,685.88867188,1827.59741211,5.60975170,350.07385254,-1,3,900); //Ambulance
    AddStaticVehicleEx(416,697.53906250,1841.11462402,5.75975227,171.24841309,-1,3,900); //Ambulance
    AddStaticVehicleEx(490,669.92352295,1846.14270020,5.65664911,215.09503174,1,1,900); //FBI Rancher
    AddStaticVehicleEx(597,683.20507812,1847.69848633,5.32010651,214.55493164,1,1,900); //Police Car (SFPD)
    AddStaticVehicleEx(609,668.04101562,1830.94836426,5.39025021,350.07501221,-1,3,900); //Boxville
    AddStaticVehicleEx(609,672.97027588,1830.17468262,5.39025021,350.07385254,-1,3,900); //Boxville
    AddStaticVehicleEx(609,677.37530518,1829.25622559,5.39025021,350.07385254,-1,3,900); //Boxville
    AddStaticVehicleEx(609,681.80017090,1828.58691406,5.39025021,350.07385254,-1,3,900); //Boxville
    AddStaticVehicleEx(490,674.38012695,1845.97412109,5.65664911,215.09033203,1,1,900); //FBI Rancher
    AddStaticVehicleEx(490,678.36822510,1846.85974121,5.65664911,215.09033203,1,1,900); //FBI Rancher
Where I'm trying to lock them
Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{

new playerid;

if(vehicleid >= 1 && vehicleid <= 12){
        if( (GetPlayerSkin(playerid) = 287) || (GetPlayerSkin(playerid) = 274) || (GetPlayerSkin(playerid) = 275) || (GetPlayerSkin(playerid) = 276) || (GetPlayerSkin(playerid) = 277) || (GetPlayerSkin(playerid) = 278) || (GetPlayerSkin(playerid) = 279) ){
            SetVehicleParamsForPlayer(vehicleid,forplayerid,0,0);
        }else{
            SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
        }
       }
return 1;
}
If you have any ideas on how to fix this, please tell me.


Re: Lock Vehicles by more than one skin - CrucixTM - 19.10.2010

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(vehicleid >= 1 && vehicleid <= 12)
    {
        new skinid == GetPlayerSkin(forplayerid);
        if(skinid == 287 || skinid == 274 || skinid == 275 || skinid == 276 || skinid == 277 || skinid == 278 || skinid == 279 )
        {
            SetVehicleParamsForPlayer(vehicleid,forplayerid,0,0);
        }
        else
        {
            SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
        }
    }
    return 1;
}
Fixed(?)

Also, you did "GetPlayerSkin(forplayerid) = #" - this means "GetPlayerSkin's value is changed to #", which is logically wrong - doesn't function.

However, "GetPlayerSkin(forplayerid) == #" - this means "if GetPlayerSkin's value is equal to the value of #", which is logically correct - works.