PHP код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
format(carros2, sizeof(carros2),"carros/%s.txt", aname);
if(DOF2_GetInt(carros2,"CarroDaConce") == 1)
{
if(DonoCarro[GetPlayerVehicleID(playerid)] != INVALID_PLAYER_ID && DonoCarro[GetPlayerVehicleID(playerid)] != playerid)
{
SendClientMessage(playerid,-1,"| ERRO | Esse veнculo nгo pertence a vocк.");
RemovePlayerFromVehicle(playerid);
}
else
{
format(msg,sizeof(msg),"{76EE00}| INFO | Bem-Vindo ao seu veнculo %s",aname);
SendClientMessage(playerid,-1,msg);
}
}
else
{
SendClientMessage(playerid ,-1,"carro pъblico");
}
return 1;
}