07.11.2016, 01:37
Код:
CMD:robstore(playerid, params[]) { new playername[25], tmp[256], tmp2[256]; new giveplayerid = GetPlayerInterior(playerid) != 0 ? adata[plastdoor[playerid]][atype] : 0; if (giveplayerid != ENTER_TYPE_SHOP) return SendClientMessage2(playerid, COLOR_RED, "Error: You are not in a store."); if (GetPlayerSkin(playerid) != pdfs[playerid] || GetPVarInt(playerid, "podfskin") != -1) return SendClientMessage2(playerid, COLOR_RED, "You are not in a civilian state (/civil)."); GetPlayerName(playerid, playername, MAX_PLAYER_NAME); new year, month, day; getdate(year, month, day); if (month < 10) year *= 10; if (day < 10) month *= 10; format(tmp, 9, "%d%d%d", year, month, day); new temp1 = strval(tmp); if (temp1 == dini_Int(AddDirFile(dir_userfiles, playername), "robbedstore")) return SendClientMessage2(playerid, COLOR_RED, "Your have already robbed a store today."); dini_IntSet(AddDirFile(dir_userfiles, playername), "robbedstore", temp1); temp1 = MRandom(25001)+5000; GivePlayerMoney(playerid, temp1); new moneys1 = GetPlayerWantedLevel(playerid); if (moneys1 < 4) { SetPlayerWantedLevel(playerid, 4); dini_IntSet(AddDirFile(dir_userfiles, playername), "Wanted", 4); } else if (moneys1 != 6) { SetPlayerWantedLevel(playerid, moneys1+1); dini_IntSet(AddDirFile(dir_userfiles, playername), "Wanted", moneys1+1); } new rand = MRandom(19)+3; for (new i = 0; i < PLAYERS; i++) { if (!IsPlayerConnected2(i) || GetPVarInt(i, "playerorg") == 0) continue; if (IsALaw(i) && GetPlayerWantedLevel(i) == 0) PlayCrimeReportForPlayer(i, playerid, rand); } format(tmp2, sizeof(tmp2), "~ %s has robbed the store in %s for $%d.", playername, zonenames[playerZone[playerid]][z_name], temp1); SendClientMessageToAll2(COLOR_SILVER, tmp2); dini_IntSet(AddDirFile(dir_userfiles, playername), "StoreRob", dini_Int(AddDirFile(dir_userfiles, playername), "StoreRob")+1); return 1; }