SA-MP Forums Archive
Doors locked help - 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: Doors locked help (/showthread.php?tid=178277)



Doors locked help - martynas - 21.09.2010

Hi,


I want to make a car lock... i made that everything works ,but when other player try to get in into car he pull me up and gets text The cars is locked and owner is : bla bla bla... but he get me off the car...


How to do that it would get animation that doors locked and get a message that car owner is : bla bla bla


Quote:

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid > maxvehicles || vehicleid < 0)
{
}
if(vehicleDB[vehicleid][locked] && !playerDB[playerid][bypass])
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name,vehicleDB[vehicleid][owner_name],true))
{
Stop(playerid);
ApplyAnimation(playerid, "PED", "CAR_doorlocked_LHS", 4.000000, 0, 0, 0, 0, -1);
new msg[128];
format(msg,sizeof(msg),"This car locked. Owner is %s",vehicleDB[vehicleid][owner_name]);
SendClientMessage(playerid,RED,msg);
return 1;
}

SendClientMessage(playerid,COLOR,"Thats yours car");
playerDB[playerid][rbool][0]=true;
}

return 1;
}



Re: Doors locked help - Seven. - 21.09.2010

I guess you will be needing:

Код:
OnVehicleStreamIn