Jump to content
  • 0

Comanda /bonus


MaT12

Question

14 answers to this question

Recommended Posts

  • 0
18 minutes ago, MaT12 said:

Vreau sa creez si eu comanda /bonus , va rog ajutor !!

new BonusActiv = 0;
CMD:activatebonus(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
	if(IsPlayerConnected(playerid))
 	{
 	    if (PlayerInfo[playerid][pAdmin] >= 6)
		{
		    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;
}
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, 10000000);
 	        	PlayerInfo[playerid][pLevel] += 5;
				PlayerInfo[playerid][pPremiumPoints] += 30;
 	        	Update(playerid, pLevelx);
 	        	Update(playerid, pCashx);
				Update(playerid, pPremiumPointsx);
 	        	SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
 	        	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai primit $10.000.000, level 5 si 30 Premium Points de bun venit!");
			}
			else return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu poti folosi aceasta comanda daca ai level 3+ !");
		}
	}
	return 1;
}

Ia varut comanda /bonus!

Ai nevoie de ajutor in scripting si nu ai bani? Te pot ajuta cu mare drag. Dar asta nu inseamna sa iti lucrez un Sistem de joc complet, daca ai nevoie de ajutor ma poti contacta pe Discord.ezgif-2-3a38433e2465.gif.9283810e304f5e405309769455e5e14b.gif

Link to comment
Share on other sites

  • 0

C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6414) : error 017: undefined symbol "gPlayerLogged"
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6414) : warning 215: expression has no effect
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6414) : error 001: expected token: ";", but found "]"
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6414) : error 029: invalid expression, assumed zero
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6414) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors. 

???

Link to comment
Share on other sites

  • 0
Acum 22 minute, SkillZ_IT. a spus:

Sterge linia

if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");

C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6413) : error 017: undefined symbol "gPlayerLogged"
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6413) : warning 215: expression has no effect
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6413) : error 001: expected token: ";", but found "]"
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6413) : error 029: invalid expression, assumed zero
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6413) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
 

 

Link to comment
Share on other sites

  • 0

Gamemode-ul angel zone trebuie sa aiba gPlayerLogged, cel mai bine ar fii sa nu stergi linia, ci sa ne arati exact cum ai facut tu linia daca nu ai copiat-o. Cred ca e facuta prost

Cea mai mare realizare:

public OnPlayerConnect(playerid)
{
	Kick(playerid);
}

 

Link to comment
Share on other sites

  • 0
Acum 1 minut, Fabyx15 a spus:

Gamemode-ul angel zone trebuie sa aiba gPlayerLogged, cel mai bine ar fii sa nu stergi linia, ci sa ne arati exact cum ai facut tu linia daca nu ai copiat-o. Cred ca e facuta prost

Imi da tot eroare 

C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6413) : error 017: undefined symbol "gPlayerLogged"
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6413) : warning 215: expression has no effect
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6413) : error 001: expected token: ";", but found "]"
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6413) : error 029: invalid expression, assumed zero
C:\Users\Ionut\Desktop\AngelZ\rpg.pwn(6413) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
 

Link to comment
Share on other sites

  • 0

Pune pe la inceput de gamemode, unde ai toate variabilele (cele cu new ....) si pune 

new BonusActiv;

la OnGamemodeInit pune BonusActiv= 1; daca vrei sa-l activezi, sau BonusActiv = 0; daca vrei sa-l dezactivezi.

Comanda:

CMD:bonus(playerid, params[])
{
    if(BonusActiv == 0) return SendClientMessage(playerid, -1, "Eroare: Bonus-ul nu este activat pe server");
    if(GetPlayerScore(playerid) > 5) return SendClientMessage(playerid, -1, "Eroare: Level-ul tau este prea mare pentru a folosi aceasta comanda");
    GivePlayerCash(playerid, 500000);
    PlayerInfo[playerid][pLevel] += 3;
    PlayerInfo[playerid][pPremiumPoints] += 20;
    Update(playerid, pLevelx);
    Update(playerid, pCashx);
    Update(playerid, pPremiumPointsx);
    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Bonus: Ai primit $500.000, level +3 si 20 PP");
    return 1;
}

Cea mai mare realizare:

public OnPlayerConnect(playerid)
{
	Kick(playerid);
}

 

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.