09.01.2016, 12:20
Nгo funciona...
Код:
public OnPlayerStateChange(playerid, newstate, oldstate){ if(newstate == PLAYER_STATE_DRIVER){ new string[256]; new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, MAX_PLAYER_NAME); for(new carro = 0; carro < MAX_CARROS; carro++){ //new vid; vid = GetPlayerVehicleID(playerid); format(string, sizeof(string), "Carros/carro%d.ini", carro); if(dini_Exists(string)){ if(vid == dini_Int(string, "Id")){ if(dini_Int(string, "TDono") == 1){ if(strcmp(dini_Get(string, "Dono"), pname, true) == 0){ SendClientMessage(playerid, Azul, " - Este carro й seu, seja bem vindo !"); } else { format(string, sizeof(string), " - Este carro nгo й seu, й de: %s", dini_Get(string, "Dono")); SendClientMessage(playerid, Azul, string); for(new i=0; i<MAX_PLAYERS; i++){ if(IsPlayerConnected(i)){ new nome[MAX_PLAYER_NAME]; GetPlayerName(i, nome, sizeof(nome)); if(strcmp(dini_Get(string, "Dono"), nome, true) == 0 && GetPlayerVehicleID(playerid) == dini_Int(string, "Id")){ format(string, sizeof(string), " - ALARME: %s(Id:%d) tentou roubar seu carro.", pname, playerid); SendClientMessage(i, tcadm, string); } } } RemovePlayerFromVehicle(playerid); } } else { format(string, sizeof(string), " - Este carro estб a venda ! Preзo: %d reais, use /comprarcarro", dini_Int(string, "Preco")); SendClientMessage(playerid, Amarelo, string); SendClientMessage(playerid, Vermelho, "Para sair do carro aperte F."); incar[playerid] = 1; TogglePlayerControllable(playerid, 0); } } } } }