Can someone here help fix my problem ?
#5

Код:
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;
}
Can u made the code can use by filterscript ? Thanks !
Reply


Messages In This Thread
Can someone here help fix my problem ? - by AngeloBrand98 - 06.11.2016, 15:21
Re: Can someone here help fix my problem ? - by PeanutButter - 06.11.2016, 15:51
Re: Can someone here help fix my problem ? - by AngeloBrand98 - 07.11.2016, 00:24
Re: Can someone here help fix my problem ? - by Pearson - 07.11.2016, 00:44
Re: Can someone here help fix my problem ? - by AngeloBrand98 - 07.11.2016, 01:37
Re: Can someone here help fix my problem ? - by IceBilizard - 07.11.2016, 03:47
Re: Can someone here help fix my problem ? - by AngeloBrand98 - 07.11.2016, 04:16
Re: Can someone here help fix my problem ? - by justice96 - 07.11.2016, 04:53

Forum Jump:


Users browsing this thread: 1 Guest(s)