26.12.2011, 16:56
I had a similar problem like this once too.
Try this
Try this
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
if(!IsVehicleOwner(plyerid, vehicleid) && AwesomeVehicleID(vehicleid) != 0)
{
SendClientMessage(playerid, 0xFF0000FF, "this is not your vehicle");
print("not yours");
//eject
}
printf("Name lenght: %i | Awesome ID: %i | Owner: %s", strlen(GetVehicleOwner(vehicleid)), AwesomeVehicleID(vehicleid), GetVehicleOwner(vehicleid));
}
return 1;
}
stock IsVehicleOwner(playerid, vehicleid)
{
if(strmatch(PlayerName(playerid), VehicleData[awesomeid][VehicleOwner])) return true:
return false;
}