02.05.2009, 20:39
hello guys please can you help me with saving property? When owner of pizza leave server i want to he gonna be write to any .txt file and when is owner and is offline he gaining money?
please what i must add here to saving owner of pizza property when is offline...?
Код:
dcmd_buy(playerid, params[]) { #pragma unused params if (IsPlayerInSphere(playerid, 375.7856,-125.9648,1001.4995,15) == 1){ if(GetPlayerMoney(playerid) >= 20000){ if(pizzalock == 0){ new jmeno[256]; GetPlayerName(playerid, jmeno, 256); new string[256]; format(string,sizeof(string), "Hrбč %s vбm odkoupil Pizzu!",PlayerName(playerid)); SendClientMessage(pizza,COLOR_RED, string); new stringi[256]; format(stringi, sizeof(stringi), "Hrбč %s koupil nemovitost Pizza!",PlayerName(playerid)); SendClientMessageToAll(COLOR_YELLOW, stringi); pizza = playerid; SendClientMessage(playerid,COLOR_GREEN, "Koupil jsi obchod Pizza!"); GivePlayerMoney(playerid, -20000); } else SendClientMessage(playerid, COLOR_RED, "Budova je zamknutб!"); } else { SendClientMessage(playerid, COLOR_RED, "Mбљ mбlo peněz!"); } }
Код:
public nemovitosti(playerid){ new codostane[MAX_PLAYER_NAME]; if(pizza <= 100){ codostane[pizza] += 2000; } if(burger <= 100){ codostane[burger] += 2000; } if(tatto <= 100){ codostane[tatto] += 2000; } if(Urban <= 100){ codostane[Urban] += 2000; } if(chuckingbels <= 100){ codostane[chuckingbels] += 2000; } if(barber <= 100){ codostane[barber] += 2000; } if(wang <= 100){ codostane[wang] += 2000; } if(bordel <= 100){ codostane[bordel] += 3500; } if(telocvicna <= 100){ codostane[telocvicna] += 2000; } if(sex <= 100){ codostane[sex] += 2000; } if(konzum <= 100){ codostane[konzum] += 3500; } if(prolaps <= 100){ codostane[prolaps] += 2000; } if(zip <= 100){ codostane[zip] += 2000; } if(mistys <= 100){ codostane[mistys] += 2000; } if(caligula <= 100){ codostane[caligula] += 10000; } if(victim <= 100){ codostane[victim] += 2000; } if(binco <= 100){ codostane[binco] += 2000; } if(emerald <= 100){ codostane[emerald] += 4000; } if(dragons <= 100){ codostane[dragons] += 7500; } if(ranch <= 100){ codostane[ranch] += 4000; } if(visage <= 100){ codostane[visage] += 4000; } for(new i; i < MAX_PLAYERS; i++) { if(codostane[i] > 0){ new castkanemovitost = codostane[i]; new string[256]; format(string,sizeof(string), "Dostal jsi %d$ za tvй nemovitosti!",codostane[i]); SendClientMessage(i,COLOR_YELLOW,string); GivePlayerMoney(i, castkanemovitost); } } }

