Jump to content
  • 0

Legatura Timer Rob


AnD

Question

Salut. Am si eu o problema. Am un sistem de rob pe server, si nu stiu cum sa ii fac un timp, adica sa pot da rob din 2 in 2 minute.

Am totul numai ca nu stiu sa ii fac legatura intre timp si comanda /rob.

Comanda /rob este:

	if(strcmp(cmd, "/rob", true) == 0 || strcmp(cmd, "/robbank", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
            if(CP[playerid] == 0)
			{
                if(Var[Robbing][playerid] == 0)
                {
	                if(PlayerToPoint(0.5,playerid,1304.5359,-1052.3643,5481.1660))
            		{
	                	if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
	   					{
	   						SCM(playerid,COLOR_WHITE,"Politistii nu pot sa Jefuiasca Banca !");
	   						return 1;
	   					}
	                    if(PlayerInfo[playerid][pRobbed] == 0)
	                    {
		                    if(RobBankOn == 0)
			                {
			                    CP[playerid] = 0;
		                    	new name[MAX_PLAYER_NAME];
				            	GetPlayerName(playerid, name, sizeof(name));
		            			SCM(playerid, -1, ""color_yellow"{00E0BB}[ROB INFO]: "wh"Acum asteapta pentru a umple sacul cu bani. Ai grija polita a fost alertata."); // bancac
								format(string, sizeof(string), "Alerta: %s a jefuit banca! ", name);
							    SendTeamMessage(2, COLOR_DBLUE, string);
							    SetPlayerAttachedObject(playerid, 2, 1550, 1, -0.004022, -0.191353, -0.034982, 158.161407, 87.838058, 0.000000, 1.000000, 1.000000, 1.000000 );
		 	               	    Var[WantedLevel][playerid] = 6;
		 	               	    SetPlayerPos(playerid,1304.5359,-1052.3643,5481.1660);
		 	               	    gPlayerUsingLoopingAnim[playerid] = 0 ;
		 	               	    SetPlayerFacingAngle(playerid, 114);
		 	               	    SetTimerEx("ResetRob", 18000, 0, "%d", playerid);
		                        Var[TimerRobTime][playerid] = 18;Var[TimerRob][playerid] = 1;Var[Robbing][playerid] = 1;RobBankOn = 1;
		 	               	    PlayerInfo[playerid][pRobbed] = 1;
			               	    SetPlayerCriminal(playerid,255, "Jefuirea banci.");
			               	    ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
							}
							else return SCM(playerid,COLOR_WHITE,"{00E0BB}[ROB INFO]:{FFFFFF}Acest seif a mai fost jefuit de cineva , trebuie sa astepti pana la payday ca se mai poata jefuii.");
						}
	                }
		            else if(PlayerToPoint(0.5,playerid,1304.5359,-1049.3643,5481.1660))
		            {
		            	if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
	   					{
	   						SCM(playerid,COLOR_WHITE,"Politistii nu pot sa Jefuiasca Banca !");
	   						return 1;
	   					}
		                if(PlayerInfo[playerid][pRobbed] == 0)
		                {
		                    if(RobBankOn1 == 0)
			                {
			                    CP[playerid] = 0;
		                    	new name[MAX_PLAYER_NAME];
				            	GetPlayerName(playerid, name, sizeof(name));
		            			SCM(playerid, -1, ""color_yellow"{00E0BB}[ROB INFO]: "wh"Acum asteapta pentru a umple sacul cu bani. Ai grija polita a fost alertata."); // bancac
								format(string, sizeof(string), "Alerta: %s a jefuit banca! ", name);
							    SendTeamMessage(2, COLOR_DBLUE, string);
							    SetPlayerAttachedObject(playerid, 2, 1550, 1, -0.004022, -0.191353, -0.034982, 158.161407, 87.838058, 0.000000, 1.000000, 1.000000, 1.000000 );
		 	               	    Var[WantedLevel][playerid] = 6;
		 	               	    SetPlayerPos(playerid,1304.5359,-1049.3643,5481.1660);
		 	               	    gPlayerUsingLoopingAnim[playerid] = 0 ;
		 	               	    SetPlayerFacingAngle(playerid, 114);
		 	               	    SetTimerEx("ResetRob", 18000, 0, "%d", playerid);
		                        Var[TimerRobTime][playerid] = 18;Var[TimerRob][playerid] = 1;Var[Robbing][playerid] = 1;RobBankOn1 = 1;
		 	               	    PlayerInfo[playerid][pRobbed] = 1;
			               	    SetPlayerCriminal(playerid,255, "Jefuirea banci.");
			               	    ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
							}
							else return SCM(playerid,COLOR_WHITE,"{00E0BB}[ROB INFO]:{FFFFFF}Acest seif a mai fost jefuit de cineva , trebuie sa astepti pana la payday ca se mai poata jefuii.");
						}

		            else return SCM(playerid, COLOR_WHITE, "{00E0BB}[ROB INFO]:{FFFFFF}Tu nu esti la banca sau nu stai unde trebuie pentru a utiliza aceasta comanda !");
		        }
        	   	else return SCM(playerid, COLOR_WHITE, "{00E0BB}[ROB INFO]:{FFFFFF} Trebuie sa termini ce ai inceput si dupa aceea poti da din nou /rob." );
            }
			else return SCM(playerid,COLOR_LIGHTRED , "{00E0BB}[ROB INFO]:{FFFFFF}Tu ai deja un checkpoint pe harta trebuie sa scapi mai intai de el ! (/deletecheck)" );
        }
        return 1;
    }
if(RobBankOn == 0) este sa pot da rob in banca los santos, if(RobBankOn1 == 0) sa pot da rob in banca lv. Asa. Mai jos este checkpointul in care am ajuns adica am finalizat rob-ul :
	else if(CP[playerid] == 4155)
    {
	    if(PlayerInfo[playerid][pRobbed] == 1)
	    {
	        CP[playerid] = 0;
	        RemovePlayerAttachedObject(playerid,2);
			GivePlayerMoney(playerid, 30000);
			SetTimerEx("robbedoff", 120000, false, "i", playerid);
			format(string,sizeof(string) , ""wh"{FFFFFF}Felicitari ! Ai jef uit banca si ai castigat "color_green"150.000$.");
			SendClientMessage(playerid, -1, string);
	        DisablePlayerCheckpoint(playerid);
		}
	}

Asa. [ SetTimerEx("robbedoff", 120000, false, "i", playerid); ] Este timpul. Acum cum fac legatura /rob cu timpul, sa pot da /rob din 2 in 2 minute?

Va rog frumos sa ma ajutati. Multumesc frumos.

www.XtremeZone.ro - Click & Register

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

Domnule - ..:[Xpllor]:.. - Daca nu vrei sa ma ajuti, poti sa nu ma ajuti, dar macar taci din gura nu  mai posta aiurea sa ai si tu posturi da? Ca asa faci cu multa lume, cica ii ajuti si de unde... Deci te rog , de acum in colo la posturile mele sa nu mai postezi nimic.

Pfff, cum sa fac acel loop :( ?

www.XtremeZone.ro - Click & Register

Link to comment
Share on other sites

Domnule - ..:[Xpllor]:.. - Daca nu vrei sa ma ajuti, poti sa nu ma ajuti, dar macar taci din gura nu  mai posta aiurea sa ai si tu posturi da? Ca asa faci cu multa lume, cica ii ajuti si de unde... Deci te rog , de acum in colo la posturile mele sa nu mai postezi nimic.

Pfff, cum sa fac acel loop :( ?

'

1.Sa stii ca acela nu a  fost un post degeaba, ii atentionam pe toti sa nu te ami ajuta ca dupac e omul te ajuta dupa aincepi sal injuri .. :-j Jalnic...

2. Cauta pe wiki.sa-mp.com despre loop si osa gasesti ;)

9zZndmN.png
Link to comment
Share on other sites

Am incercat sa fac si asa:

public robbedoff(playerid)

{

    for(new i = 0; i < MAX_PLAYERS; i++)

    {

    if(PlayerInfo[playerid][pRobbed] == 1)

    {

RobBankOn = 0;

    RobBankOn1 = 0;

    Var[Robbing][playerid] = 0;

    PlayerInfo[pRobbed] = 0;

    }

}

  alreadyrobbed[playerid] = 0;

    return 1;

}

Si tot nu merge. Vreau sa fac ca dupa ce se termina timpul acela [ SetTimerEx("robbedoff", 120000, 0, "%d", playerid); ] Sa pot jefui banca adica sa se activeze functiile RobBankOn, si RobBankOn1 ca sa pot jefui bancile. Cum pot face ?

www.XtremeZone.ro - Click & Register

Link to comment
Share on other sites

Faci o functie care o pui la comanda sa se seteze pe 1,gen:

new robbedbank[MAX_PLAYERS];
La comanda pui sa se seteze pe 1
robbedbank[playerid] = 1;
Si tot la comanda pui sa verifice daca este pe 1
if(robbedbank[playerid] == 1) return SendClientMessage(playerid, -1, "Ai jefuit deja banca");
Faci un public sa il seteze pe 0
public SetRobOn(playerid)
{
      robbedbank[playerid] = 0;
      SendClientMessage(playerid, -1, "Poti jefuii banca");
}
Si timerul il pui cand termina de jefuit
SetTimerEx("SetRobOn", 120000, false, "i", playerid);

gXvsYS
Link to comment
Share on other sites

:.." post="125161" timestamp="1349849887"]

nu il mai ajutati ma pe AnD

view this: http://www.sa-mp.ro/forum/index.php/topic,22496.0.html

Sincer, nu am motive sa nu il ajut.

Mi-a facut mie ceva?Din poza aia de unde sa stiu ca nu cumva tu ai inceput conflictul.

Mai bine taceai din gura,obesrv eu gresit sau pe site-ul asta nu mai exista moderatori/administratori?

rszadc33936a6e246e39ea2.png
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.