03.08.2010, 04:10
(
Последний раз редактировалось Scones; 03.08.2010 в 11:01.
)
The players in my server cant access cars unless they are cops :S
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new newcar = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(IsACopCar(newcar))
{
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3) { }
else {
RemovePlayerFromVehicle(playerid);
}
}
if(IsAnEMSCar(newcar))
{
if(PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4) { }
else {
RemovePlayerFromVehicle(playerid);
}
}
if(IsYakuzaCar(newcar))
{
if(PlayerInfo[playerid][pMember]==6||PlayerInfo[playerid][pLeader]==6) { }
else {
RemovePlayerFromVehicle(playerid);
}
}
if(IsItalianCar(newcar))
{
if(PlayerInfo[playerid][pMember]==14||PlayerInfo[playerid][pLeader]==14) { }
else {
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
pawn Код:
public IsACopCar(carid)
{
if(carid>=1&&carid<=33||carid==70||carid==80||carid>=75||carid<=78)
{
return 1;
}
return 0;
}
public IsYakuzaCar(carid)
{
if((carid >= 64 && carid <= 69||carid >= 71 && carid <=74))
{
return 1;
}
return 0;
}
public IsItalianCar(carid)
{
if((carid >= 79 && carid <= 87))
{
return 1;
}
return 0;
}
public IsAnEMSCar(carid)
{
if(carid>=34&&carid<=46)
{
return 1;
}
return 0;
}