13.03.2013, 20:38
This should work for you, basically your 'strcmp' function was using the cell length parameter, which does not equal 20 in this case... I won't explain it now, but research it a little and you'll understand.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
//get vehicle id
new vid;
new factionrequired[5] = "None";
vid = GetVehicleModel(vehicleid);
//check for factions
for(new i = 0; i < sizeof(LSPDvehicles); i++)
{
if(vid == LSPDvehicles[i])
{
factionrequired = "LSPD";
break;
}
else if(vid == LSFDvehicles[i])
{
factionrequired = "LSFD";
break;
}
else if(vid == taxivehicles[i])
{
factionrequired = "taxi";
break;
}
}
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) == 0)
{
SendClientMessage(playerid, -1, "allowed");
}
else
{
SendClientMessage(playerid, -1, "not allowed");
ClearAnimations(playerid);
}
return 1;
}