SA-MP Forums Archive
Link skin to a vehicle - 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: Link skin to a vehicle (/showthread.php?tid=211276)



Link skin to a vehicle - Jacob_T_Harden - 14.01.2011

Ok.. Ive been experimenting with PAWNO since I am new.. Iam working on my very first script, Its finally playable.. Just adding cool features.. Anyways I was wondering how I can link a skin to a vehicle, I learned how to make certain skins only be able to use commands.. But can somebody show me how to do the same thing with like medic skins to an ambulance ETC. Using this format or close to it
Код:
new pskin=GetPlayerSkin(playerid);
    if(pskin == 265 || pskin == 266 ||
Thank you!


Re: Link skin to a vehicle - wilko1995 - 14.01.2011

On the vehicle you want to link the skin to you must get the id. eg
pawn Код:
new mycar;

mycar = AddStaticVehicle(bla);
after that
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new veh = GetPlayerVehicleID(playerid);
        new pskin=GetPlayerSkin(playerid);
        if(pskin != 265 || pskin != 266 && veh == mycar) // Guessing that those are the skins you want in the car
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, 0x00FF00AA, "This car is only for players with skin 265 or skin 266");
                return 1;
            }
        return 1;
    }
    return 0;
}



Re: Link skin to a vehicle - Jacob_T_Harden - 15.01.2011

Is there anyway I can use that one thing for many vehicles? If so, How?


Re: Link skin to a vehicle - Hal - 15.01.2011

Quote:
Originally Posted by Jacob_T_Harden
Посмотреть сообщение
Is there anyway I can use that one thing for many vehicles? If so, How?
If you want it for specific vehicles, just run an
pawn Код:
if
statment above it all to check for specific vehicle ids(or group id thats set to a car (( if thats in place)) )

You will have multiple snippets like that for each skin that is linked to a vehicle


(i just realized that i do not make sense.)


Re: Link skin to a vehicle - Jacob_T_Harden - 15.01.2011

?? That made no sense...
Can you explain a little better? =)


Re: Link skin to a vehicle - wilko1995 - 15.01.2011

check you PM