Jump to content
  • 0

Timer la /loadmission


Mititel

Question

9 answers to this question

Recommended Posts

Aratane si noua ce ai incercat sa faci ?

I.

new MISIUNEDIMINEATA[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 41, 45 };
new MISIUNEPRANZ[] = { 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 42, 46 };
new MISIUNESEARA[] = { 21, 22, 23, 24, 25, 26, 27, 28, 29 ,30, 43 };
new MISIUNEMIEZUNOPTII[] = { 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 44 };
II.
forward setmis(playerid);
public setmis(playerid)
{
		new hour,minute,second;
		gettime(hour,minute,second);
		if (hour == 08 && minute == 00 && second == 00)
		{
  			new rand = random(sizeof(MISIUNEDIMINEATA));
			LoadMission(playerid,MISIUNEDIMINEATA[rand]);
			return 1;
		}
		if (hour == 14 && minute == 00 && second == 00)
		{
  			new rand = random(sizeof(MISIUNEPRANZ));
			LoadMission(playerid,MISIUNEPRANZ[rand]);
			return 1;
		}
		if (hour == 20 && minute == 00 && second == 00)
		{
			new rand = random(sizeof(MISIUNESEARA));
			LoadMission(playerid,MISIUNESEARA[rand]);
			return 1;
		}
		if (hour == 02 && minute == 00 && second == 00)
		{
			new rand = random(sizeof(MISIUNEMIEZUNOPTII));
			LoadMission(playerid,MISIUNEMIEZUNOPTII[rand]);
			return 1;
		}

		return 1;
}
III.
public LoadMission(playerid,name[])
{
	if(IsPlayerConnected(playerid))
	{
		new strFromFile2[128];
		new missionname[64];
		format(missionname, sizeof(missionname), "%s.mis",name);
		new File: file = fopen(missionname, io_read);
		if (file)
		{
		    new key[ 256 ] , val[ 256 ];
		    new Data[ 256 ];
		    while ( fread( file , Data , sizeof( Data ) ) )
			{
				key = ini_GetKey( Data );
				if( strcmp( key , "Title" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kTitle], val, 0, strlen(val), 255); }
				if( strcmp( key , "Maker" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kMaker], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text1" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText1], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text2" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText2], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text3" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText3], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text4" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText4], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text5" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText5], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text6" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText6], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text7" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText7], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text8" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText8], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text9" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText9], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text10" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText10], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text11" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText11], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text12" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText12], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text13" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText13], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text14" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText14], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text15" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText15], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text16" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText16], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text17" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText17], val, 0, strlen(val), 255); }
				if( strcmp( key , "Text18" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kText18], val, 0, strlen(val), 255); }
				if( strcmp( key , "GText1" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kGText1], val, 0, strlen(val), 255); }
				if( strcmp( key , "GText2" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kGText2], val, 0, strlen(val), 255); }
				if( strcmp( key , "GText3" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kGText3], val, 0, strlen(val), 255); }
				if( strcmp( key , "GText4" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kGText4], val, 0, strlen(val), 255); }
				if( strcmp( key , "GText5" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kGText5], val, 0, strlen(val), 255); }
				if( strcmp( key , "GText6" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayMission[kGText6], val, 0, strlen(val), 255); }
				if( strcmp( key , "CP1X" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP1][0] = floatstr( val ); }
				if( strcmp( key , "CP1Y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP1][1] = floatstr( val ); }
				if( strcmp( key , "CP1Z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP1][2] = floatstr( val ); }
				if( strcmp( key , "CP2X" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP2][0] = floatstr( val ); }
				if( strcmp( key , "CP2Y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP2][1] = floatstr( val ); }
				if( strcmp( key , "CP2Z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP2][2] = floatstr( val ); }
				if( strcmp( key , "CP3X" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP3][0] = floatstr( val ); }
				if( strcmp( key , "CP3Y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP3][1] = floatstr( val ); }
				if( strcmp( key , "CP3Z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP3][2] = floatstr( val ); }
				if( strcmp( key , "CP4X" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP4][0] = floatstr( val ); }
				if( strcmp( key , "CP4Y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP4][1] = floatstr( val ); }
				if( strcmp( key , "CP4Z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP4][2] = floatstr( val ); }
				if( strcmp( key , "CP5X" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP5][0] = floatstr( val ); }
				if( strcmp( key , "CP5Y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP5][1] = floatstr( val ); }
				if( strcmp( key , "CP5Z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP5][2] = floatstr( val ); }
				if( strcmp( key , "CP6X" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP6][0] = floatstr( val ); }
				if( strcmp( key , "CP6Y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP6][1] = floatstr( val ); }
				if( strcmp( key , "CP6Z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kCP6][2] = floatstr( val ); }
				if( strcmp( key , "Number" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kNumber] = strval( val ); }
				if( strcmp( key , "Reward" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kReward] = strval( val ); }
				if( strcmp( key , "Toggle" , true ) == 0 ) { val = ini_GetValue( Data ); PlayMission[kToggle] = strval( val ); }
			}
			fclose(file);
			format(strFromFile2, sizeof(strFromFile2), "%s Mission Loaded.",name);
			SendClientMessage(playerid, COLOR_GREEN,strFromFile2);
			format(strFromFile2, sizeof(strFromFile2), "Mission Available: %s, By : %s | Reward: $%d",PlayMission[kTitle],PlayMission[kMaker],PlayMission[kReward]);
			SendClientMessageToAll(COLOR_GREEN, strFromFile2);
			MissionPlayable = PlayMission[kNumber];
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREEN,"Mission File not found.");
		}
	}
	return 1;
}

Nu imi da nici o erroare sau un warning ,dar in joc nu se activeaza automat.Am incercat sa o activez singur cu /loaddmion [numar] si imi spune ca "Mission File not found."

default.png
Link to comment
Share on other sites

Uite aici un sistem de mission mai bun si super calumea!

/Mission+CP-uri

[pawn]forward MissionOn(playerid);

new CP[MAX_PLAYERS];

public OnPlayerEnterCheckpoint(playerid)

{

      if(CP[playerid]==999)//mission1_2

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1000;

      SetPlayerCheckpoint(playerid, 1461.8387,-1011.8854,26.4082, 3.0);

      GameTextForPlayer(playerid,"Zona spawn civili",1500,5);

  }

      else if(CP[playerid]==1000)//mission1_3

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1001;

      SetPlayerCheckpoint(playerid, 1485.9828,-1739.3678,13.1136, 3.0);

      GameTextForPlayer(playerid,"Banca LS",1500,5);

  }

      else if(CP[playerid]==1001)//mission1_4

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1002;

      SetPlayerCheckpoint(playerid, 1734.8783,-1950.4221,13.6871, 3.0);

      GameTextForPlayer(playerid,"Primaria",1500,5);

  }

      else if(CP[playerid]==1002)//mission1_5

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1003;

      SetPlayerCheckpoint(playerid, 1539.6160,-1674.1183,13.1133, 3.0);

      GameTextForPlayer(playerid,"Gara LS",1500,5);

  }

    else if(CP[playerid]==1002)//mission1_6

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1003;

      SetPlayerCheckpoint(playerid, 1792.4084,-1164.6584,23.3963, 3.0);

      GameTextForPlayer(playerid,"LSPD",1500,5);

  }

      else if(CP[playerid]==1003)//mission1_7

  {

      DisablePlayerCheckpoint(playerid);

        SendClientMessage(playerid,COLOR_GREEN,"Ai terminat misiunea Easy-Turul Orasului, castig:50.000$");

      GameTextForPlayer(playerid,"Gsls1",1500,5);

      GivePlayerMoney(playerid, 50000);

  }

  //misiuni//

  //misiuni//

      else if(CP[playerid]==1004)//mission1_2

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1005;

      SetPlayerCheckpoint(playerid, 1461.8387,-1011.8854,26.4082, 3.0);

      GameTextForPlayer(playerid,"Zona spawn civili",1500,5);

  }

      else if(CP[playerid]==1005)//mission1_3

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1006;

      SetPlayerCheckpoint(playerid, 1485.9828,-1739.3678,13.1136, 3.0);

      GameTextForPlayer(playerid,"Banca LS",1500,5);

  }

      else if(CP[playerid]==1006)//mission1_4

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1007;

      SetPlayerCheckpoint(playerid, 1734.8783,-1950.4221,13.6871, 3.0);

      GameTextForPlayer(playerid,"Primaria",1500,5);

  }

      else if(CP[playerid]==1007)//mission1_5

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1008;

      SetPlayerCheckpoint(playerid, 1539.6160,-1674.1183,13.1133, 3.0);

      GameTextForPlayer(playerid,"Gara LS",1500,5);

  }

    else if(CP[playerid]==1008)//mission1_6

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1009;

      SetPlayerCheckpoint(playerid, 1792.4084,-1164.6584,23.3963, 3.0);

      GameTextForPlayer(playerid,"LSPD",1500,5);

  }

      else if(CP[playerid]==1009)//mission1_7

  {

      DisablePlayerCheckpoint(playerid);

      SendClientMessage(playerid,COLOR_GREEN,"Ai terminat misiunea Medium-Turul Orasului, castig:75.000$");

      GameTextForPlayer(playerid,"Gsls1",1500,5);

      GivePlayerMoney(playerid, 75000);

  }

  //misiuni//

  //misiuni//

      else if(CP[playerid]==1010)//mission1_2

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1011;

      SetPlayerCheckpoint(playerid, 1461.8387,-1011.8854,26.4082, 3.0);

      GameTextForPlayer(playerid,"Zona spawn civili",1500,5);

  }

      else if(CP[playerid]==1011)//mission1_3

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1012;

      SetPlayerCheckpoint(playerid, 1485.9828,-1739.3678,13.1136, 3.0);

      GameTextForPlayer(playerid,"Banca LS",1500,5);

  }

      else if(CP[playerid]==1012)//mission1_4

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1013;

      SetPlayerCheckpoint(playerid, 1734.8783,-1950.4221,13.6871, 3.0);

      GameTextForPlayer(playerid,"Primaria",1500,5);

  }

      else if(CP[playerid]==1013)//mission1_5

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1014;

      SetPlayerCheckpoint(playerid, 1539.6160,-1674.1183,13.1133, 3.0);

      GameTextForPlayer(playerid,"Gara LS",1500,5);

  }

    else if(CP[playerid]==1014)//mission1_6

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1015;

      SetPlayerCheckpoint(playerid, 1792.4084,-1164.6584,23.3963, 3.0);

      GameTextForPlayer(playerid,"LSPD",1500,5);

  }

      else if(CP[playerid]==1015)//mission1_7

  {

      DisablePlayerCheckpoint(playerid);

      SendClientMessage(playerid,COLOR_GREEN,"Ai terminat misiunea Hard-Turul Orasului, castig:100.000$");

      GameTextForPlayer(playerid,"Gsls1",1500,5);

      GivePlayerMoney(playerid, 100000);

  }

  //misiuni//

  //misiuni//

      else if(CP[playerid]==1016)//mission1_2

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1017;

      SetPlayerCheckpoint(playerid, 1461.8387,-1011.8854,26.4082, 3.0);

      GameTextForPlayer(playerid,"Zona spawn civili",1500,5);

  }

      else if(CP[playerid]==1017)//mission1_3

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1019;

      SetPlayerCheckpoint(playerid, 1485.9828,-1739.3678,13.1136, 3.0);

      GameTextForPlayer(playerid,"Banca LS",1500,5);

  }

      else if(CP[playerid]==1019)//mission1_4

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1020;

      SetPlayerCheckpoint(playerid, 1734.8783,-1950.4221,13.6871, 3.0);

      GameTextForPlayer(playerid,"Primaria",1500,5);

  }

      else if(CP[playerid]==1020)//mission1_5

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1021;

      SetPlayerCheckpoint(playerid, 1539.6160,-1674.1183,13.1133, 3.0);

      GameTextForPlayer(playerid,"Gara LS",1500,5);

  }

    else if(CP[playerid]==1021)//mission1_6

  {

      DisablePlayerCheckpoint(playerid);

      CP[playerid] = 1003;

      SetPlayerCheckpoint(playerid, 1792.4084,-1164.6584,23.3963, 3.0);

      GameTextForPlayer(playerid,"LSPD",1500,5);

  }

      else if(CP[playerid]==1023)//mission1_7

  {

      DisablePlayerCheckpoint(playerid);

      SendClientMessage(playerid,COLOR_GREEN,"Ai terminat misiunea Expert-Turul Orasului, castig:125.000$");

      GameTextForPlayer(playerid,"Gsls1",1500,5);

      GivePlayerMoney(playerid, 125000);

  }

  //misiuni//

}

  public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

{

if(dialogid==mission)

    {

    if(response)

  {

        if(listitem==0)

        {

            ShowPlayerDialog(playerid,999,DIALOG_STYLE_LIST,""color_yellow"Easy","1.Turul orasului \n2.Turul factiunilor \n3.Turul bizz-urilor","Alege","Iesi");

}

            if(listitem==1)

        {

            ShowPlayerDialog(playerid,1000,DIALOG_STYLE_LIST,""color_yellow"Medium","1.Turul orasului \n2.Turul factiunilor \n3.Turul bizz-urilor","Alege","Iesi");

}

            if(listitem==2)

        {

            ShowPlayerDialog(playerid,1001,DIALOG_STYLE_LIST,""color_yellow"Hard","1.Turul orasului \n2.Turul factiunilor \n3.Turul bizz-urilor","Alege","Iesi");

}

            if(listitem==3)

        {

            ShowPlayerDialog(playerid,1002,DIALOG_STYLE_LIST,""color_yellow"Expert","1.Turul orasului \n2.Turul factiunilor \n3.Turul bizz-urilor","Alege","Iesi");

}

}

}

  if(dialogid==999)

    {

    if(response)

  {

        if(listitem==0)

        {

        new str[1024];

        format(str,1024,""wh"• Ai pornit misiunea Easy, Turul Orasului");

        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

        CP[playerid] = 999;

        SetPlayerCheckpoint(playerid,899.5523,-1656.5289,13.1095,1.0);

        MissionOn();

        return 1;

        }

  }

  }

      if(dialogid==1000)

    {

    if(response)

  {

        if(listitem==0)

        {

        new str[1024];

        format(str,1024,""wh"• Ai pornit misiunea Medium, Turul Orasului");

        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

        CP[playerid] = 1004;

        SetPlayerCheckpoint(playerid,899.5523,-1656.5289,13.1095,1.0);

        MissionOn();

        return 1;

        }

  }

  }

      if(dialogid==1001)

    {

    if(response)

  {

        if(listitem==0)

        {

        new str[1024];

        format(str,1024,""wh"• Ai pornit misiunea Hard, Turul Orasului");

        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

        CP[playerid] = 1010;

        SetPlayerCheckpoint(playerid,899.5523,-1656.5289,13.1095,1.0);

        MissionOn();

        return 1;

        }

  }

  }

      if(dialogid==1002)

    {

    if(response)

  {

        if(listitem==0)

        {

        new str[1024];

        format(str,1024,""wh"• Ai pornit misiunea Expert, Turul Orasului");

        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

        CP[playerid] = 1016;

        SetPlayerCheckpoint(playerid,899.5523,-1656.5289,13.1095,1.0);

        MissionOn();

        return 1;

        }

  }

}

//=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-mission-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  if(strcmp(cmd,"/mission",true)==0)

    {

        if(IsPlayerConnected(playerid))

        {

        if(!PlayerToPoint(3.0,playerid,1381.0413,-1088.8511,27.3906))

        {

            SCM(playerid, COLOR_GREY, "  You are not at the Bill Board !");

            return 1;

        }

        if(PlayerMissioned[playerid] == -1)

            {

                SendClientMessage(playerid,COLOR_GREY,"Poti face misiunea o data la 3 ore!");

                return 1;

            }

            ShowPlayerDialog(playerid,998,DIALOG_STYLE_LIST,""color_yellow"Misiuni","1.Easy \n2.Medium \n3.Hard \n4.Expert","Alege","Iesi");

      }

        SetTimerEx("ResetMission", 1080000, 0, "d", playerid);

            PlayerMissioned[playerid] = -1;

        return 1;

    }

    //timerul

public MissionOn(playerid)

{

    SetTimerEx("ResetMission", 1080000, 0, "d", playerid);

    PlayerMissioned[playerid] = -1;

    }

new Music[MAX_PLAYERS];

new Songs[7][1] = {

{1187},

{1185},

{1183},

{1097},

{1076},

{1068},

{1062}

};

//la public CustomPickups() punem:

if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,1381.0413,-1088.8511,27.3906))[/pawn]

La /mission puteti pune ca playerii sa primeasca wanted la pornire misiune si ce va mai trece voua prin cap.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.