14.11.2013, 20:33
Код:
if(dialogid == AvtoProdazba) { if(response) { if(IsAnOwnableCar(idcar)) { if(PlayerInfo[playerid][pLevel] < 2) { SendClientMessage(playerid, COLOR_GREY, "Potreben vie Level 2 za da Go kupite!"); RemovePlayerFromVehicle(playerid); TogglePlayerControllable(playerid, 1); return 1; } if(PlayerInfo[playerid][pPcarkey] == 999) { } else if(PlayerInfo[playerid][pPcarkey2] == 999) { } else { SendClientMessage(playerid, COLOR_GREY, "Vekje Poseduvate 2 Avtomobila"); RemovePlayerFromVehicle(playerid); TogglePlayerControllable(playerid, 1); return 1; } if(CarInfo[idcar][cOwned]==1) { SendClientMessage(playerid, COLOR_GREY, "Nekoj Vekje go kupil ovoj Avtomobil"); RemovePlayerFromVehicle(playerid); return 1; } if(GetPlayerMoney(playerid) >= CarInfo[idcar][cValue]) { if(PlayerInfo[playerid][pPcarkey] == 999) { PlayerInfo[playerid][pPcarkey] = idcar; } else if(PlayerInfo[playerid][pPcarkey2] == 999) { PlayerInfo[playerid][pPcarkey2] = idcar; } else { return 1; } CarInfo[idcar][cOwned] = 1; GetPlayerName(playerid, sendername, sizeof(sendername)); strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999); GivePlayerMoney(playerid,-CarInfo[idcar][cValue]); PlayerPlayMusic(playerid); GameTextForPlayer(playerid, "~w~Cestito Go kupivte Avtomobilot!", 5000, 3); SendClientMessage(playerid, COLOR_GRAD2, "Sega Mozete Da go Vozite,za KOmandi koristete /avtomobil!"); TogglePlayerControllable(playerid, 1); dini_Create(idcar); OnPropUpdate(idcar); OnPlayerUpdate(playerid); return 1; } else { SendClientMessage(playerid, COLOR_GREY, "Nemate Dovolno Pari za da go kupite ovoj avtomobil! "); RemovePlayerFromVehicle(playerid); TogglePlayerControllable(playerid, 1); return 1; } } }