Jump to content
  • 0

[Cerere]Comanda


MrAndyAdv

Question

10 answers to this question

Recommended Posts

  • 0
new	BonusActiv = 0;

Comanda activatebonus: 

CMD:activatebonus(playerid, params[]) //-> Cu aceasta comanda activezi bonus-ul [/bonus]
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first. .");
	if(IsPlayerConnected(playerid))
 	{
 	    if (PlayerInfo[playerid][pAdmin] >= 4)
		{
		    if(BonusActiv == 0) 
 	    	{
 	    	    BonusActiv = 1;
 	    	    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai activat comanda /bonus!");
			}
			else
			{
			    BonusActiv = 0;
			    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai dezactivat comanda /bonus!");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
		}
	}
	return 1;
}

Comanda bonus:

CMD:bonus(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first. .");
	if(IsPlayerConnected(playerid))
 	{
 	    if(BonusActiv > 0)
 	    {
 	    	if(PlayerInfo[playerid][pLevel] <= 2)
 	    	{
 	        	GivePlayerCash(playerid, 69000000); // -> Cash $
 	        	PlayerInfo[playerid][pLevel] = 69; // -> Level-ul
 	        	PlayerInfo[playerid][pExp] += 69; // -> RespectPoints
 	        	Update(playerid, pLevelx);
 	        	Update(playerid, pCashx);
 	        	Update(playerid, pExp);
 	        	SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
 	        	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai primit $69.000.000, 69 rp-uri si level 69 de bun venit!");
			}
			else return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu poti folosi aceasta comanda daca ai level 3+ !");
		}
	}
	return 1;
}new	BonusActiv = 0;

Comanda activatebonus: 

CMD:activatebonus(playerid, params[]) //-> Cu aceasta comanda activezi bonus-ul [/bonus]
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first. .");
	if(IsPlayerConnected(playerid))
 	{
 	    if (PlayerInfo[playerid][pAdmin] >= 4)
		{
		    if(BonusActiv == 0) 
 	    	{
 	    	    BonusActiv = 1;
 	    	    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai activat comanda /bonus!");
			}
			else
			{
			    BonusActiv = 0;
			    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai dezactivat comanda /bonus!");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
		}
	}
	return 1;
}

 

Edited by xAlexutzuDsK_
Link to comment
Share on other sites

  • 0
Acum 2 ore, xAlexutzuDsK_ a spus:

new	BonusActiv = 0;

Comanda activatebonus: 

CMD:activatebonus(playerid, params[]) //-> Cu aceasta comanda activezi bonus-ul [/bonus]
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first. .");
	if(IsPlayerConnected(playerid))
 	{
 	    if (PlayerInfo[playerid][pAdmin] >= 4)
		{
		    if(BonusActiv == 0) 
 	    	{
 	    	    BonusActiv = 1;
 	    	    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai activat comanda /bonus!");
			}
			else
			{
			    BonusActiv = 0;
			    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai dezactivat comanda /bonus!");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
		}
	}
	return 1;
}

Comanda bonus:

CMD:bonus(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first. .");
	if(IsPlayerConnected(playerid))
 	{
 	    if(BonusActiv > 0)
 	    {
 	    	if(PlayerInfo[playerid][pLevel] <= 2)
 	    	{
 	        	GivePlayerCash(playerid, 69000000); // -> Cash $
 	        	PlayerInfo[playerid][pLevel] = 69; // -> Level-ul
 	        	PlayerInfo[playerid][pExp] += 69; // -> RespectPoints
 	        	Update(playerid, pLevelx);
 	        	Update(playerid, pCashx);
 	        	Update(playerid, pExp);
 	        	SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
 	        	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai primit $69.000.000, 69 rp-uri si level 69 de bun venit!");
			}
			else return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu poti folosi aceasta comanda daca ai level 3+ !");
		}
	}
	return 1;
}new	BonusActiv = 0;

Comanda activatebonus: 

CMD:activatebonus(playerid, params[]) //-> Cu aceasta comanda activezi bonus-ul [/bonus]
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first. .");
	if(IsPlayerConnected(playerid))
 	{
 	    if (PlayerInfo[playerid][pAdmin] >= 4)
		{
		    if(BonusActiv == 0) 
 	    	{
 	    	    BonusActiv = 1;
 	    	    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai activat comanda /bonus!");
			}
			else
			{
			    BonusActiv = 0;
			    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai dezactivat comanda /bonus!");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
		}
	}
	return 1;
}

Comanda bonus:

CMD:bonus(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first. .");
	if(IsPlayerConnected(playerid))
 	{
 	    if(BonusActiv > 0)
 	    {
 	    	if(PlayerInfo[playerid][pLevel] <= 2)
 	    	{
 	        	GivePlayerCash(playerid, 69000000); // -> Cash $
 	        	PlayerInfo[playerid][pLevel] = 69; // -> Level-ul
 	        	PlayerInfo[playerid][pExp] += 69; // -> RespectPoints
 	        	Update(playerid, pLevelx);
 	        	Update(playerid, pCashx);
 	        	Update(playerid, pExp);
 	        	SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
 	        	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai primit $69.000.000, 69 rp-uri si level 69 de bun venit!");
			}
			else return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu poti folosi aceasta comanda daca ai level 3+ !");
		}
	}
	return 1;
}

 

Tot nu merge... nustiu ce sa-i mai fac .. imi da 4 errori incerc sa le rezorv si mai dau inca 20

Link to comment
Share on other sites

  • 0
Acum 2 ore, MrAndy a spus:

Salut! si bine te-am gasit ! dupa cum vezi in  titul am nevoie de o comanda si nu imi iese aceea comanda este [/bonus] care am incercat sa iti dea level 2 si 300.00.00$

Te duci la OnpPlayerCommandText si adaugi urmatoarele:

if(strcmp(cmd, "/bonus", true) == 0)
    {
         if(PlayerToPoint(1.0, playerid, Aici pui coordonatele unde playerul poate scrie comanda de exemplu unde il spawneza))
         {
            if(PlayerInfo[playerid][pLevel] <= 1)
            {
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid,COLOR_LIGHTGREEN,"{CCDEE0}Felicitari.Ai primit Level 3 si 5000{00FA1D} LEI {CCDEE0}Bonus! ");
                    SendClientMessage(playerid,COLOR_LIGHTGREEN,"O zi buna in continuare alaturi de {7E82CA}RuGmy{EC7365}RPG !");
                    GivePlayerCash(playerid, 5000);
                    PlayerInfo[playerid][pLevel] = 3;
                    format(string, sizeof(string), "UPDATE players SET PlayerLevel='%d' WHERE id=%d", PlayerInfo[playerid][pLevel]);
            }
        }
        return 1;
    }


                   Dupa accea te duci si creezi un text3D:
CreateDynamic3DTextLabel("{DB1616}Bonus din partea ..............\n{ECC962}Scrie /Bonus pentru a-ti lua Bonus-ul",0xFFFFFFFF,Aici pui coordonatele unde vrei sa scrie si unde sa dea /bonus bine ar fi sa pui aceleasi coordonate ca cele de mai sus, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);

 

DAca nu ai inteles ceva dai reply aici
 

Edited by Extremys
Greseala

giphy.gif

Link to comment
Share on other sites

  • 0

Pai e normal sa nu iti mearga :)) pentru ca tu ai alte functii definite in GameMode ..

 

PlayerInfo[playerid][pLevel] = 69; // -> Level-ul
 	        	PlayerInfo[playerid][pExp] += 69; // -> RespectPoints
 	        	Update(playerid, pLevelx);
 	        	Update(playerid, pCashx);
 	        	Update(playerid, pExp);

 

 

Link to comment
Share on other sites

  • 0
Acum 2 ore, VenoWW a spus:

Pai e normal sa nu iti mearga :)) pentru ca tu ai alte functii definite in GameMode ..

 


PlayerInfo[playerid][pLevel] = 69; // -> Level-ul
 	        	PlayerInfo[playerid][pExp] += 69; // -> RespectPoints
 	        	Update(playerid, pLevelx);
 	        	Update(playerid, pCashx);
 	        	Update(playerid, pExp);

 

 

si astea unde se pun?... din cate tin eu minte in 'GamemodeOnEdit' ceva in gen

Link to comment
Share on other sites

  • 0
Acum 3 minute, MrAndy a spus:

si astea unde se pun?... din cate tin eu minte in 'GamemodeOnEdit' ceva in gen

Nu se pun ma nicaieri! Trebuie sa cauti cum ai tu definite acele functii

In loc de pLevelx poate tu ai PlayerLevel sau pLevel! Da-mi pm si te ajut

Link to comment
Share on other sites

  • 0
Acum 2 ore, VenoWW a spus:

Nu se pun ma nicaieri! Trebuie sa cauti cum ai tu definite acele functii

In loc de pLevelx poate tu ai PlayerLevel sau pLevel! Da-mi pm si te ajut

Nu , am cum ai spus tu , dar nustiu unde sa le pun.. :|

Link to comment
Share on other sites

  • 0

Se pare ca habar nu ai de programare.

Multa bafta!

Baga la cap si dupa poti venii sa ceri ajutor:

           -https://wiki.sa-mp.com/wiki/Scripting_Basics

           -Special pentru pruncii de 10 ani dar si pentru alte varste ;)) (Just try it):https://code.org/learn

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.