Levelu jautaajums

Ja kas neizprotams.

Moderator: Moderātori

Post Reply
User avatar
Tektro
Jauniņais
Jauniņais
Posts: 34
Joined: 23 Sep 2012, 12:40

Levelu jautaajums

Post by Tektro » 29 Sep 2012, 23:08

Kas taalaak jaailiek lai vareetu uzlikt lietosanas komandas piem /repair
te kods

Code: Select all

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buylevel", cmdtext, true) == 0)
	    {
            //1.LVL
//1lvl
if(GetPlayerScore(playerid)==0)
	   	    {
	 		if(GetPlayerMoney(playerid) < 300000)//
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 1. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 1);
		        GivePlayerMoney(playerid, -300000);//
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 1. Lîmeni. Tagad jums ir iespçja lietot /repair, lai salabotu maðînu nekur nebraucot!");
				}
			return 1;
			}
            //2.LVL
if(GetPlayerScore(playerid)==1)
				{
			if(GetPlayerMoney(playerid) < 500000)//Nauda
				{
		        SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 2. lîmeni!");
				}
		 	else
		        {
		        SetPlayerScore(playerid, 2);
		        GivePlayerMoney(playerid, -500000);//Nauda.....
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 2. Lîmeni. Tagad jums ir iespçja lietot /flip komandu!");
				}
			return 1;
			}
			//3.lvl
if(GetPlayerScore(playerid)==2)
	   	    {
	 		if(GetPlayerMoney(playerid) < 800000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 3. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 3);
		        GivePlayerMoney(playerid, -800000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 3. Lîmeni. Tagad jums ir iespçja lietot /lock un /unlock komandu, lai aizslçgtu un atslçgtu maðînu!");
				}
			return 1;
			}
			//4.lvl
if(GetPlayerScore(playerid)==3)
	   	    {
	 		if(GetPlayerMoney(playerid) < 1200000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 4. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 4);
		        GivePlayerMoney(playerid, -1200000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 4. Lîmeni. Tagad jums ir iespçja lietot /savecar un /getcar komandu, lai izsauktu jûsu saglabâto maðînu!");
				}
			return 1;
			}
			//5.lvl
if(GetPlayerScore(playerid)==4)
	   	    {
	 		if(GetPlayerMoney(playerid) < 1600000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 5. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 5);
		        GivePlayerMoney(playerid, -1600000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 5. Lîmeni. Tagad jums ir iespçja lietot /tune komandu, lai uztûnçtu maðînu nekur nebraucot!");
				}
			return 1;
			}
//6.lvl
if(GetPlayerScore(playerid)==5)
	   	    {
	 		if(GetPlayerMoney(playerid) < 2000000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 6. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 6);
		        GivePlayerMoney(playerid, -2000000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 6. Lîmeni. Tagad jums ir iespçja lietot /afon un /afoff komandu, lai ieslçgtu un izslçgtu antifall!");
				}
			return 1;
			}
			//7.lvl
if(GetPlayerScore(playerid)==6)
	   	    {
	 		if(GetPlayerMoney(playerid) < 2400000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 7. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 7);
		        GivePlayerMoney(playerid, -2400000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 7. Lîmeni. Tagad jums ir iespçja lietot /count komandu, lai ieslçgtu laika atskaiti!");
				}
			return 1;
			}
//8.lvl
if(GetPlayerScore(playerid)==7)
	   	    {
	 		if(GetPlayerMoney(playerid) < 3000000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 8. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 8);
		        GivePlayerMoney(playerid, -3000000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 8. Lîmeni. Tagad jums spawnojoties bûs bruòas!");
				}
			return 1;
			}
			//9.lvl
if(GetPlayerScore(playerid)==8)
	   	    {
	 		if(GetPlayerMoney(playerid) < 3600000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 9. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 9);
		        GivePlayerMoney(playerid, -3600000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 9. Lîmeni. Tagad jums ir iespçja lietot /parachute komandu, lai paòemtu izpletni!");
				}
			return 1;
			}
			//10.lvl
if(GetPlayerScore(playerid)==9)
	   	    {
	 		if(GetPlayerMoney(playerid) < 4000000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 10. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 10);
		        GivePlayerMoney(playerid, -4000000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 10. Lîmeni. Tagad jums ir iespçja lietot /neons komandu, lai ievietotu maðînâ neonus!");
				}
			return 1;
			} //11.lvl
if(GetPlayerScore(playerid)==10)
	   	    {
	 		if(GetPlayerMoney(playerid) < 4400000)//
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 11. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 11);
		        GivePlayerMoney(playerid, -4400000);//
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 11. Lîmeni. Tagad jums ir iespçja lietot /repair, lai salabotu maðînu nekur nebraucot!");
				}
			return 1;
			}
            //12.LVL
if(GetPlayerScore(playerid)==11)
				{
			if(GetPlayerMoney(playerid) < 4800000)//Nauda
				{
		        SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 12. lîmeni!");
				}
		 	else
		        {
		        SetPlayerScore(playerid, 12);
		        GivePlayerMoney(playerid, -4800000);//Nauda.....
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 12. Lîmeni!");
				}
			return 1;
			}
			//13.lvl
if(GetPlayerScore(playerid)==12)
	   	    {
	 		if(GetPlayerMoney(playerid) < 5400000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 13. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 13);
		        GivePlayerMoney(playerid, -5400000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 13. Lîmeni.!");
				}
			return 1;
			}
			//14.lvl
if(GetPlayerScore(playerid)==13)
	   	    {
	 		if(GetPlayerMoney(playerid) < 6000000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 14. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 14);
		        GivePlayerMoney(playerid, -6000000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 14. Lîmeni!");
				}
			return 1;
			}
			//15.lvl
if(GetPlayerScore(playerid)==14)
	   	    {
	 		if(GetPlayerMoney(playerid) < 6300000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 15. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 15);
		        GivePlayerMoney(playerid, -6300000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 15. Lîmeni!");
				}
			return 1;
			}
//16.lvl
if(GetPlayerScore(playerid)==15)
	   	    {
	 		if(GetPlayerMoney(playerid) < 6800000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 16. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 16);
		        GivePlayerMoney(playerid, -6800000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 16. Lîmeni!");
				}
			return 1;
			}
			//17.lvl
if(GetPlayerScore(playerid)==16)
	   	    {
	 		if(GetPlayerMoney(playerid) < 7400000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 17. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 17);
		        GivePlayerMoney(playerid, -7400000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 17. Lîmeni!");
				}
			return 1;
			}
//18.lvl
if(GetPlayerScore(playerid)==17)
	   	    {
	 		if(GetPlayerMoney(playerid) < 8000000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 18. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 18);
		        GivePlayerMoney(playerid, -8000000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 18. Lîmeni!");
				}
			return 1;
			}
			//19.lvl
if(GetPlayerScore(playerid)==18)
	   	    {
	 		if(GetPlayerMoney(playerid) < 8400000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 19. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 19);
		        GivePlayerMoney(playerid, -8400000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 19. Lîmeni!");
				}
			return 1;
			}
			//20.lvl

if(GetPlayerScore(playerid)==19)
	   	    {
	 		if(GetPlayerMoney(playerid) < 8800000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 20. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 20);
		        GivePlayerMoney(playerid, -8800000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 20. Lîmeni!");
				}
			return 1;
			}
			//21.lvl
if(GetPlayerScore(playerid)==20)
	   	    {
	 		if(GetPlayerMoney(playerid) < 9400000)//
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 21. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 21);
		        GivePlayerMoney(playerid, -9400000);//
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 21. Lîmeni!");
				}
			return 1;
			}
            //22.LVL
if(GetPlayerScore(playerid)==21)
				{
			if(GetPlayerMoney(playerid) < 10000000)//Nauda
				{
		        SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 22. lîmeni!");
				}
		 	else
		        {
		        SetPlayerScore(playerid, 22);
		        GivePlayerMoney(playerid, -10000000);//Nauda.....
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 22. Lîmeni!");
				}
			return 1;
			}
			//23.lvl
if(GetPlayerScore(playerid)==22)
	   	    {
	 		if(GetPlayerMoney(playerid) < 10300000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 23. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 23);
		        GivePlayerMoney(playerid, -10300000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 23. Lîmeni!");
				}
			return 1;
			}
			//24.lvl
if(GetPlayerScore(playerid)==23)
	   	    {
	 		if(GetPlayerMoney(playerid) < 10700000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 24. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 24);
		        GivePlayerMoney(playerid, -10700000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 24. Lîmeni!");
				}
			return 1;
			}
			//25.lvl
if(GetPlayerScore(playerid)==24)
	   	    {
	 		if(GetPlayerMoney(playerid) < 11300000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 25. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 25);
		        GivePlayerMoney(playerid, -11300000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 25. Lîmeni. Tagad jums ir iespçja lietot /tune komandu, lai uztûnçtu maðînu nekur nebraucot!");
				}
			return 1;
			}
//26.lvl
if(GetPlayerScore(playerid)==25)
	   	    {
	 		if(GetPlayerMoney(playerid) < 11700000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 26. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 26);
		        GivePlayerMoney(playerid, -117000000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 26. Lîmeni!");
				}
			return 1;
			}
			//27.lvl
if(GetPlayerScore(playerid)==26)
	   	    {
	 		if(GetPlayerMoney(playerid) < 12100000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 27. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 27);
		        GivePlayerMoney(playerid, -12100000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 27. Lîmeni. Tagad jums ir iespçja lietot /count komandu, lai ieslçgtu laika atskaiti!");
				}
			return 1;
			}
//28.lvl
if(GetPlayerScore(playerid)==27)
	   	    {
	 		if(GetPlayerMoney(playerid) < 12500000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 28. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 28);
		        GivePlayerMoney(playerid, -12500000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 28. Lîmeni. Tagad jums spawnojoties bûs bruòas!");
				}
			return 1;
			}
			//29.lvl
if(GetPlayerScore(playerid)==28)
	   	    {
	 		if(GetPlayerMoney(playerid) < 13900000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 29. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 29);
		        GivePlayerMoney(playerid, -13900000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 29. Lîmeni. Tagad jums ir iespçja lietot /parachute komandu, lai paòemtu izpletni!");
				}
			return 1;
			}
			//30.lvl

if(GetPlayerScore(playerid)==29)
	   	    {
	 		if(GetPlayerMoney(playerid) < 14500000)
	   		    {
	   		    SendClientMessage(playerid, 0xE6000033, "Jums nav pietiekami daudz naudas, lai nopirktu 30. lîmeni!");
				}
			else
		        {
		        SetPlayerScore(playerid, 30);
		        GivePlayerMoney(playerid, -14500000);
		        SendClientMessage(playerid, 0x33AA33AA, "Apsveicam! Jûs iegâdâjâties 30. Lîmeni!");
    }
			return 1;
			}

if(GetPlayerScore(playerid) ==30)
			{
SendClientMessage(playerid, 0xE6000033, "Tev jau ir maksimaalais pieejamais liimenis!");
}
return 1;
        }
return 1;
}
peec peedeejaa return 1
gribu turpinaat likt komandas

User avatar
[OFF]katelmaisis
Censoņa
Censoņa
Posts: 255
Joined: 20 May 2009, 14:00

Re: Levelu jautaajums

Post by [OFF]katelmaisis » 30 Sep 2012, 10:09

Image

[BB]Chill
Censoņa
Censoņa
Posts: 367
Joined: 25 Jun 2012, 13:47
Location: Garāža
Contact:

Re: Levelu jautaajums

Post by [BB]Chill » 24 Dec 2012, 14:03

Un ko tas dod?

User avatar
[NF]Magnifico
Censoņa
Censoņa
Posts: 245
Joined: 09 Oct 2011, 02:17
Location: Cēsis
Contact:

Re: Levelu jautaajums

Post by [NF]Magnifico » 26 Dec 2012, 14:40

Šīs levelu sistēmas taču ir novecojušas. Priekškam taisīt jaunus SA-MP mēneša projektus, un tērēt savu laiku?
Ja nu tomēr esi nolēmis taisīt tālāk serveri un tērēt savu laiku ar šiem noveocojušajiem leveliem, tad man nav žēl palīdzēt.

Kā redzu šī līmeņu sistēma balstās uz score, tad tam priekš tevis problēmas nevajadzētu sagādāt.

Ja komanda tev jau ir gatava, bet tā jāuzliek uz kāda noteikta līmeņa, tad izmanto funkciju, ar kuru ir iespējams manipulēt ar score. Šajā gadījumā -
GetPlayerScore(playerid); un SetPlayerScore(playerid); ja ar score ir nepieciešams manipulēt jebkuram spēlētājam, jeb "playerid".

Tātad piemērs, kā skriptā ievietot līmeņu pārbaudi.

Code: Select all

if(strcmp(cmdtext, "/komanda", true) == 0)
	{
	if(GetPlayerScore(playerid) <= šeitlīmenis)
		{
		SendClientMessage(playerid,krāsa,"Šeit var ievietot skriptu, kas ir  pieejams līmenī");
		}
	else
		{
		SendClientMessage(playerid,krāsa,"Šeit var ievietot tekstu ko aizsūta spēlētājam, ja viņam nav noteiktā līmeņa.");
		}
	return 1;
	}
"šeitlīmenis" vietā ievieto līmeni, kurš ir nepieciešams spēlētājam lai lietotu šo komandu.

"krāsa" vietā ievieto krāsu ar kādu spēlētājam tiks nosūtīta ziņa. Protams šis bija tikai piemērs un pārējās komandas ir jātaisa tev pašam.

Stiivais
Jauniņais
Jauniņais
Posts: 11
Joined: 04 Feb 2013, 06:45

Re: Levelu jautaajums

Post by Stiivais » 28 Aug 2013, 11:58

@Tektro ja tu pats būtū veidojis šo levelu sistēmu tu zinātu ka izveidot priekš tās komandu :)

Post Reply