i want something that every player enter a personal vehicle send a message that this vehicle is for %s
i do this but when i enter every vehicle that are not personal vehicle it send me the message
Код:
if(newstate == PLAYER_STATE_DRIVER && oldstate != PLAYER_STATE_DRIVER)
{
if(PlayerInfo[playerb][pVeh] || PlayerInfo[playerb][pVVeh] || PlayerInfo[playerb][pBVeh])
{
format(string, sizeof(string), "** you entered to %s 's vehicle **", RPN(playerb));
SendClientMessage(playerid,COLOR_LIGHTB,string);
}
else
{
format(string, sizeof(string), "** %s wellcome to your vehicle**", RPN(playerid));
SendClientMessage(playerid,COLOR_LIGHTB,string);
}
return 1;
}
PlayerInfo[playerb][pVeh] , PlayerInfo[playerb][pVVeh] and PlayerInfo[playerb][pBVeh] are your personal vehicles variable ??
Код:
if(GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVeh] && GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVVeh] && GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pBVeh]) return SendClientMessage(playerid, COLOR_GREY, "Shoma Nistid Dar vehicle you can park.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have parked your vehicle, it will always spawn here until you park it somewhere else.");
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh])
{
for(new i=0; i<14; i++)
{
PlayerInfo[playerid][pVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pVeh], i);
}
topened[playerid] = 0;
GetVehiclePos(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ]);
GetVehicleZAngle(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vA]);
DestroyVehicle(PlayerInfo[playerid][pVeh]);
PlayerInfo[playerid][pVeh] = CreateVehicle(PlayerInfo[playerid][vModel], PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ],PlayerInfo[playerid][vA],PlayerInfo[playerid][vC1],PlayerInfo[playerid][vC2],32000);
SetVehicleVirtualWorld(PlayerInfo[playerid][pVeh], GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(PlayerInfo[playerid][pVeh], GetPlayerInterior(playerid));
ChangeVehiclePaintjob(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vPJ]);
for(new i=0; i<14; i++)
{
AddVehicleComponent(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVehMod][i]);
}
}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVeh])
{
for(new i=0; i<14; i++)
{
PlayerInfo[playerid][pVVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pVVeh], i);
}
GetVehiclePos(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ]);
GetVehicleZAngle(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVA]);
DestroyVehicle(PlayerInfo[playerid][pVVeh]);
PlayerInfo[playerid][pVVeh] = CreateVehicle(PlayerInfo[playerid][vVModel], PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ],PlayerInfo[playerid][vVA],PlayerInfo[playerid][vVC1],PlayerInfo[playerid][vVC2],32000);
SetVehicleVirtualWorld(PlayerInfo[playerid][pVVeh], GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(PlayerInfo[playerid][pVVeh], GetPlayerInterior(playerid));
ChangeVehiclePaintjob(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVPJ]);
for(new i=0; i<14; i++)
{
AddVehicleComponent(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][pVVehMod][i]);
}
}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pBVeh])
{
for(new i=0; i<14; i++)
{
PlayerInfo[playerid][pBVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pBVeh], i);
}
GetVehiclePos(PlayerInfo[playerid][pBVeh],PlayerInfo[playerid][vBX], PlayerInfo[playerid][vBY], PlayerInfo[playerid][vBZ]);
GetVehicleZAngle(PlayerInfo[playerid][pBVeh],PlayerInfo[playerid][vBA]);
DestroyVehicle(PlayerInfo[playerid][pBVeh]);
PlayerInfo[playerid][pBVeh] = CreateVehicle(PlayerInfo[playerid][vBModel], PlayerInfo[playerid][vBX], PlayerInfo[playerid][vBY], PlayerInfo[playerid][vBZ],PlayerInfo[playerid][vBA],PlayerInfo[playerid][vBC1],PlayerInfo[playerid][vBC2],32000);
SetVehicleVirtualWorld(PlayerInfo[playerid][pBVeh], GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(PlayerInfo[playerid][pBVeh], GetPlayerInterior(playerid));
ChangeVehiclePaintjob(PlayerInfo[playerid][pBVeh], PlayerInfo[playerid][vBPJ]);
for(new i=0; i<14; i++)
{
AddVehicleComponent(PlayerInfo[playerid][pBVeh], PlayerInfo[playerid][pBVehMod][i]);
}
}
return 1;
}