SA-MP Forums Archive
How to Make? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to Make? (/showthread.php?tid=335077)



How to Make? - sampmark05 - 17.04.2012

How to make a bank robbery system for my RP server? Any Hints?


Re: How to Make? - ReneG - 17.04.2012

Your question is way too general. Have you even tried giving this a shot yourself? If you get stuck, then post here.


Re: How to Make? - ReneG - 17.04.2012

Quote:
Originally Posted by HardBubblez
Посмотреть сообщение
Me ?
Obviously not. My previous post was towards the original poster.


Re: How to Make? - sampmark05 - 17.04.2012

I already make a bank robbery system but i want to convert it to zcmd

Код:
	if(strcmp(cmd, "/robbank", true) == 0)
	{
	    if(PlayerInfo[playerid][pLevel] < 4)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "   You must be a level 4 or higher to be able to rob the bank.");
	        return 1;
	    }
		if(IsACop(playerid))
	    {
	    	SendClientMessage(playerid, COLOR_GREY, "   Law Enforcement Officials cannot rob the bank.");
	    	return 1;
	    }
		if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1448.44, -988.52, 1639.78))
	    {
			SendClientMessage(playerid, COLOR_GREY, "   You are not at the bank safe.");
			return 1;
	    }
		if(TimeAfterBankJob < TIME_BETWEEN_BANKJOBS)
	    {
	    	new bjt;
	    	bjt = TIME_BETWEEN_BANKJOBS - TimeAfterBankJob;
	    	format(string, sizeof(string), "   You must wait %d hours before making the next bank robbery attempt.", bjt);
			SendClientMessage(playerid, COLOR_GREY, string);
			return 1;
	    }
		if(BankJobPlayer < 999 && BankJobPlayer != playerid)
	    {
		    SendClientMessage(playerid, COLOR_GREY, "   Someone is already robbing the bank.");
		    return 1;
	    }
		if(BankJobPlayer == playerid)
	    {
	    	format(string, 256, "   You're already robbing the bank! %d minutes left.", BankJobTime / 2);
	    	SendClientMessage(playerid, COLOR_GREY, string);
	    	return 1;
	    }
	    new Cops = 0;
	    for(new i = 0; i < MAX_PLAYERS; i++)
		{
		    if(IsACop(i))
		    {
		        Cops += 1;
		    }
		}
		if(!(Cops >= 3))
		{
		    SendClientMessage(playerid,COLOR_GREY,"   There must be at least 3 Law Enforcement Officials online.");
		    return 1;
		}
		format(string, 256, "You have started the robbery, you must stay inside the bank for %d minutes.", BANK_JOB_TIME/2);
		SendClientMessage(playerid, COLOR_WHITE, string);
		if(PlayerInfo[playerid][pWantedLevel] <= 1)
		{
		    PlayerInfo[playerid][pWantedLevel] += 5;
		}
		else if(PlayerInfo[playerid][pWantedLevel] >= 2)
		{
		    PlayerInfo[playerid][pWantedLevel] = 6;
		}
		SetPlayerCriminal(playerid, 999, "Bank Robbery");
		format(string, 256, "City Alert: The Los Santos Bank is being robbed!");
		SendClientMessageToAll(COLOR_LIGHTBLUE, string);
		BankJobTime = BANK_JOB_TIME;
		BankJobPlayer = playerid;
		return 1;
	}



Re: How to Make? - ReneG - 17.04.2012

I highly doubt you made this. This is obviously straight from the godfather roleplay or something.


Re: How to Make? - sampmark05 - 17.04.2012

yup its from GF. how do i convert it?


Re: How to Make? - Jonny5 - 17.04.2012

lol you have released a filter script that uses ZCMD but you cant convert this code?


forgive me if i missed something here.


Re: How to Make? - sampmark05 - 17.04.2012

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
lol you have released a filter script that uses ZCMD but you cant convert this code?


forgive me if i missed something here.
Thanks you for your question Mr. Johnny5 i found a way to convert this to zcmd in *******


Re: How to Make? - sampmark05 - 17.04.2012

Is this correct ?
Код:
CMD:robbank(playerid, params[])
{
    if(PlayerInfo[playerid][pLevel] < 4)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "   You must be a level 4 or higher to be able to rob the bank.");
	        return 1;
	    }
    if(IsACop(playerid))
	    {
	    	SendClientMessage(playerid, COLOR_GREY, "   Law Enforcement Officials cannot rob the bank.");
	    	return 1;
	    }
    if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1448.44, -988.52, 1639.78))
	    {
			SendClientMessage(playerid, COLOR_GREY, "   You are not at the bank safe.");
			return 1;
	    }
    if(TimeAfterBankJob < TIME_BETWEEN_BANKJOBS)
	    {
	    	new bjt;
	    	bjt = TIME_BETWEEN_BANKJOBS - TimeAfterBankJob;
	    	format(string, sizeof(string), "   You must wait %d hours before making the next bank robbery attempt.", bjt);
			SendClientMessage(playerid, COLOR_GREY, string);
			return 1;
	    }
    		if(BankJobPlayer < 999 && BankJobPlayer != playerid)
	    {
		    SendClientMessage(playerid, COLOR_GREY, "   Someone is already robbing the bank.");
		    return 1;
	    }
		if(BankJobPlayer == playerid)
	    {
	    	format(string, 256, "   You're already robbing the bank! %d minutes left.", BankJobTime / 2);
	    	SendClientMessage(playerid, COLOR_GREY, string);
	    	return 1;
	    }
	    new Cops = 0;
	    for(new i = 0; i < MAX_PLAYERS; i++)
		{
		    if(IsACop(i))
		    {
		        Cops += 1;
		    }
		}
		if(!(Cops >= 3))
		{
		    SendClientMessage(playerid,COLOR_GREY,"   There must be at least 3 Law Enforcement Officials online.");
		    return 1;
		}
		format(string, 256, "You have started the robbery, you must stay inside the bank for %d minutes.", BANK_JOB_TIME/2);
		SendClientMessage(playerid, COLOR_WHITE, string);
		if(PlayerInfo[playerid][pWantedLevel] <= 1)
		{
		    PlayerInfo[playerid][pWantedLevel] += 5;
		}
		else if(PlayerInfo[playerid][pWantedLevel] >= 2)
		{
		    PlayerInfo[playerid][pWantedLevel] = 6;
		}
		SetPlayerCriminal(playerid, 999, "Bank Robbery");
		format(string, 256, "City Alert: The Los Santos Bank is being robbed!");
		SendClientMessageToAll(COLOR_LIGHTBLUE, string);
		BankJobTime = BANK_JOB_TIME;
		BankJobPlayer = playerid;
		return 1;
	}