13.03.2013, 15:55
pawn Код:
new LSPDvehicles[] =
{
596, 597, 598, 599, 601, 497, 528, 490, 430
};
new LSFDvehicles[] =
{
416, 544, 407, 563
};
new taxivehicles[] =
{
420, 431, 437, 438
};
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
//get vehicle id
new vid;
new factionrequired[10];
vid = GetVehicleModel(vehicleid);
//check for factions
for(new i = 0; i <= 7; i++)
{
if(vid == LSPDvehicles[i])
{
factionrequired = "LSPD";
} else if(vid == LSFDvehicles[i])
{
factionrequired = "LSFD";
} else if(vid == taxivehicles[i])
{
factionrequired = "taxi";
} else {
factionrequired = "none";
}
}
new test[128];
format(test, sizeof(test), "FactionRequired: %s - Faction: %s", factionrequired, pInfo[playerid][Faction]);
SendClientMessage(playerid, -1, test);
if(!strcmp(pInfo[playerid][Faction], factionrequired, true, 20))
{
SendClientMessage(playerid, -1, "allowed");
} else {
SendClientMessage(playerid, -1, "not allowed");
}
return 1;
}