11.03.2012, 09:21
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new personalcar = (dini_Int(PFile(playerid),"CarID"));
for(new i=0; i < MAX_PLAYERS; i++)
{
if(GetCreatorID(vehicleid)!=0)
{
if (personalcar == vehicleid)
{
SetVehicleParamsForPlayer(vehicleid,i,0,0);
}
else
{
if (VehicleSystem[vehicleid][cLock]==0)
{
SetVehicleParamsForPlayer(vehicleid,i,0,1);
}
else if (VehicleSystem[vehicleid][cLock]==1)
{
SetVehicleParamsForPlayer(vehicleid,i,0,0);
}
}
}
return 1;
}
if(IsACharacter(playerid))
{
if (IsACopCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pMember]==3) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsAnAmbulance(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==4||PlayerInfo[playerid][pMember]==4) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsACivCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]>= 0 ||PlayerInfo[playerid][pMember]>=0) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsALcnCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==5||PlayerInfo[playerid][pMember]==5) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsAYkzCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==6||PlayerInfo[playerid][pMember]==6) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsAHitmanCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==8||PlayerInfo[playerid][pMember]==8) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsANewsCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==9||PlayerInfo[playerid][pMember]==9) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsATaxiCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==10||PlayerInfo[playerid][pMember]==10) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsAnInstructorCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==11||PlayerInfo[playerid][pMember]==11) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsABloodsCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==12||PlayerInfo[playerid][pMember]==12) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsACripsCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==13||PlayerInfo[playerid][pMember]==13) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsANortenosCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==14||PlayerInfo[playerid][pMember]==14) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsASurenosCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==15||PlayerInfo[playerid][pMember]==15) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsAGrooveCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==16||PlayerInfo[playerid][pMember]==16) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsABallasCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==17||PlayerInfo[playerid][pMember]==17) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsAFmaCar(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pLeader]==18||PlayerInfo[playerid][pMember]==18) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if (IsADmvCar(vehicleid) && !ispassenger)
{
if(TakingLesson[playerid] == 1)
{
}
else
{
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
}
return 1;
}