if(dialogid == PRODAZBA) { if(response) { if(GetPlayerMoney(playerid) >= SellCarInfo[SellCost]) { new string[256], tmp[256]; GiveCarTo(SellCarInfo[VehID],SellCarInfo[Owner], playerid, SellCarInfo[SellCost]); format(string, sizeof(string), "Ja prifativte ponudata na %s", Gn(SellCarInfo[Owner])); SendClientMessage(playerid, Green, string); format(tmp, sizeof(tmp), "%s Ja prifati vasata ponuda", Gn(playerid)); SendClientMessage(SellCarInfo[Owner], Green, tmp); } else { SendClientMessage(playerid, Red, "GRESKA:{FFFFFF}Nemate dovolno pari !!!"); } } else { new string[128], vehicleid; format(string, sizeof(string), "%s Ja odbi vasata ponuda ...", Gn(playerid)); SendClientMessage(VehicleInfo[vehicleid][Owner], Red, string); } return 1; } return 0; } |
GiveCarTo(vehicleid, playerid, playerid2, cost) { SetPlayerVehicle(playerid2, vehicleid); SetPlayerNotHaveVehicle(playerid); GivePlayerMoney(playerid, cost); GivePlayerMoney(playerid2, -cost); SetVehicleOwner2(vehicleid, playerid2); } // this is fo having vehicle forward SetPlayerVehicle(playerid, vehicleid); public SetPlayerVehicle(playerid, vehicleid) { dini_IntSet(PFile(playerid),"HaveCar",1); dini_IntSet(VFile(vehicleid),"Owned",1); dini_Set(VFile(vehicleid),"Owner",Gn(playerid)); dini_IntSet(PFile(playerid),"CarID",vehicleid); } |