Jump to content

deleted content


nobilzeusAdv
 Share

Recommended Posts

 

C:\Users\User\Desktop\samp\Black_D\gamemodes\BigZoneGM.pwn(7495) : error 017: undefined symbol "COLOR_MONEY"
C:\Users\User\Desktop\samp\Black_D\gamemodes\BigZoneGM.pwn(7496) : error 017: undefined symbol "SCMTA"
C:\Users\User\Desktop\samp\Black_D\gamemodes\BigZoneGM.pwn(7549) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\samp\Black_D\gamemodes\BigZoneGM.pwn(7579) : error 017: undefined symbol "PlayerHit"
C:\Users\User\Desktop\samp\Black_D\gamemodes\BigZoneGM.pwn(7579) : warning 215: expression has no effect
C:\Users\User\Desktop\samp\Black_D\gamemodes\BigZoneGM.pwn(7579) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\samp\Black_D\gamemodes\BigZoneGM.pwn(7579) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\samp\Black_D\gamemodes\BigZoneGM.pwn(7579) : fatal error 107: too many error messages on one line
 
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
 
 
6 Errors.

 

=]]] copy paste?:))))

Link to comment
Share on other sites

 

  • Username: nobilzeusAdv
  • Creator: nobilzeus || eu
  • Tutorial/Ghid: cadou zburator asemantor b-hood

Video prezentare: https://www.youtube.com/watch?v=h6dxag3IzQA&t=153s PS: e mai vechi =)

 

Muzica de ascultat cand te uiti la acest tutorial:

https://www.youtube.com/watch?v=ekDBhzfwOPY&list=PLZrWvA1I919w9Xv_LAsHgOgWRB_mCXxiN

 

Pentru inceput o sa ai nevoie de include-ul y_timers doarece o sa ne folosim de stock-ul SCMF 

#include <YSI\y_timers>

INFO: Daca ai primit eroare la foreach, acela este y_foreach

modificati din foreach(new i : Player) in foreach(Player, i)

--> 

stock SCMF(playerid, colour, const fmat[], va_args<>) {
	new UsageString[256]; va_format(UsageString, 128, fmat, va_start<3>);
	return SCM(playerid, colour, UsageString); 
}

---X

Informatiile functiilor/etc o sa fie mai jos.

 

 

mergem la inceputul gm-ului si creăm niste variabile necesare pentru sistem.

definim si dialogul de care avem nevoie, daca tineti la aspect puteti sa puneti dialogul la coloana de dialoguri.

new cadouzburator,azisceva,PlayerText:cadouzburatorPTD[1],PlayerBar:cadouBAR[MAX_PLAYERS],
    flamazburator,cadoulbl,Text3D:Cadolabel,cadoulqw[MAX_PLAYERS],dmgdat[MAX_PLAYERS],
    cadoumort,cadoulevel,cadoumesaj,collectobject,colectgf[MAX_PLAYERS],cadoumsg,
    cadoubani[MAX_PLAYERS],cadoupp[MAX_PLAYERS],cadourp[MAX_PLAYERS],cadouviatai,cadoutimer[MAX_PLAYERS],
    parazburator,cadoutimeractiv[MAX_PLAYERS],cadouviata;

in caz ca nu aveti in gm puneti si new PlayerHit[MAX_PLAYERS];

#define DIALOG_COLLECTCADOU 	6006

mergem la ongamemodeinit si adaugam

cadoumort = 1;

//cand se porneste serverul definim cadoul mort, iar din comanda /dropgift o sa fie spawnat

mergem la onplayerdisconnect si adaugam

if(dmgdat[playerid] > 0) KillTimer(cadoutimer[playerid]),DestroyPlayerProgressBar(playerid, cadouBAR[playerid]);

//daca erai in event si ai iesit sa se stearga textdraw-ul si progresbarr-ul

mergem la onplayergivedamage si adaugam

if(cadoumort == 0) {
		new Float:x,Float:y,Float:z;
		GetObjectPos(cadouzburator, x,y,z);
		if(PlayerToPoint(60.0, playerid, x,y,z)) {
					if(!IsPlayerInAnyVehicle(playerid) && PlayerHit[playerid] != damagedid && PaintType[playerid] == 0 && InWar[PlayerInfo[playerid][pMember]] == 0) {
						SCM(playerid, COLOR_LIGHTRED, "Ai primit freeze timp de 5 secunde deoarece ai lovit pe cineva intr-o zona protejata.");
						TogglePlayerControllable(playerid, 0);
						SetTimerEx("UnFreezeStation", 5000, false, "i", playerid);
						new Float:hp = GetPlayerHealth(PlayerHit[playerid], hp);
						SetPlayerHealthEx(PlayerHit[playerid], hp+damagedid);
					}
		}		
	}

mergem la OnDialogResponse si adugam la switch(dialogid)

case DIALOG_COLLECTCADOU: {
			GivePlayerCash(playerid, cadoubani[playerid]);
			Update(playerid, pCashx);
			if(dmgdat[playerid] > 500) PlayerInfo[playerid][pPremiumPoints] += cadoupp[playerid], PlayerInfo[playerid][pExp] += cadourp[playerid];
			Update(playerid, pPremiumPointsx);
			Update(playerid, pRP);
			UpdateProgress(playerid, 0);
			SCM(playerid, COLOR_MONEY,"(Gift Box) Ai colectat premiul!");
			colectgf[playerid] = 1;
		}

mergem la onplayerweaponshot si adugam

if(hittype == BULLET_HIT_TYPE_OBJECT) //info 9
    { 
    	if(weaponid == 31 || weaponid == 24 || weaponid == 26 || weaponid == 25 || weaponid == 29 || weaponid == 30 || weaponid == 33 || weaponid == 25)
    	{
    		if(azisceva == 1) return 1;
            if(hitid == cadouzburator) 
            { 
            	new dmg = 5;
                cadouviata -= dmg,cadoubani[playerid] += 250,dmgdat[playerid] += dmg,cadoulabel();
                if(cadoutimeractiv[playerid] == 0) {
	                if(cadoumesaj != 0) return 1;
	                cadoutimer[playerid] = SetTimerEx("updatecadoubar", 100, true, "%d", playerid);
	                cadoutimeractiv[playerid] = 1;
            	}
                if(cadouviata <= 0) 
                {
	                cadoumort = 1,cadoumsg = 0,cadoulbl = 0,cadoulevel = 0,azisceva = 1,cadoumesaj = 1;
	            	new Float:pos[3];
	            	GetObjectPos(cadouzburator, pos[0],pos[1],pos[2]);collectobject = CreateObject(1577,  pos[0],pos[1],pos[2], 0,0,0, 100.0);UpdateDynamic3DTextLabelText(Cadolabel, COLOR_WHITE, "Pentru a colecta premiul foloseste /collectgift!");
	                foreach(new i : Player) {
	            	if(dmgdat[i] > 500) cadourp[i] = 1, cadoupp[i] = 1 + random(2);
	                if(dmgdat[i] > 0) SCM(i,COLOR_MONEY, "(Gift Box) Pentru a colecta premiul foloseste /collectgift!");
	                SCMTA(COLOR_MONEY, "(Gift Box) Pentru a vizualiza participanti foloseste /topevent!");
	                KillTimer(cadoutimer[i]),PlayerTextDrawHide(i, cadouzburatorPTD[0]),DestroyPlayerProgressBar(i, cadouBAR[i]),DestroyObject(cadouzburator),DestroyObject(flamazburator);
            		}
          	    }	 
        	}
   		} 
    }

a se adauga la sfarsitul gm-ului de preferat

//start event info 1
function cadouzb() { 
	if(cadoumsg == 1) return 1;
	new indiciu = random(3);cadoulevel = 1 + random(3);
	switch(indiciu) {case 0: cadouzburator = CreateObject(19054,3066.0925,2091.6895,322.0981, 0,0,0, 500),MoveObject(cadouzburator,2901.3501,2040.6469,10.8203,30),SCMTA(COLOR_DEPART, "(Gift Box) Un obiect a fost aruncat din avion in orasul Las Venturas'. Indiciu: Ocean.");case 1: cadouzburator = CreateObject(19054,1342.2188,-2685.3093,273.5103, 0,0,0, 500),MoveObject(cadouzburator,1418.4274,-2621.2546,13.5469,30),SCMTA(COLOR_DEPART, "(Gift Box) Un obiect a fost aruncat din avion in orasul Los Santos'. Indiciu: Aero."); case 2: cadouzburator = CreateObject(19054,1079.5297,1067.8638,270.8250, 0,0,0, 500),MoveObject(cadouzburator,1088.6166,1070.4855,10.8359,30),SCMTA(COLOR_DEPART, "(Gift Box) Un obiect a fost aruncat din avion in orasul Las Venturas'. Indiciu: BattleGrounds.");} SCMTA(COLOR_DEPART, "(Gift Box) Acest obiect are forma unui cadou si o sa ajunga la sol in cateva secunde!"),SCMTA(COLOR_DEPART, "(Gift Box) Toti jucatorii care au participat vor primi un premiu, insa cel mai bun o sa primasca un premiu special!");
	parazburator = CreateObject(2903, 0,0,0,0,0,0, 500),AttachObjectToObject(parazburator, cadouzburator, 0,0,6,0,0,0, 1);flamazburator = CreateObject(18728, 0,0,0,0,0,0, 500),AttachObjectToObject(flamazburator, cadouzburator, 0,0,-2,0,0,0, 1);
	switch(cadoulevel){ case 1: cadouviata = 1200; case 2: cadouviata = 1700; case 3: cadouviata = 2300;}
	foreach(new i : Player) dmgdat[i] = 0,cadoubani[i] = 0,cadourp[i] = 0,cadoupp[i] = 0,cadoutimeractiv[i] = 0,cadoulqw[i] = 0,colectgf[i] = 0;
	cadoumort = 0,cadoumsg = 1,azisceva = 0,cadoumesaj = 0,cadouviatai = cadouviata;
	SetTimer("destroypara", 12000, false),DestroyObject(collectobject),DestroyDynamic3DTextLabel(Cadolabel);
	return 1;
}
//distrugere parachute info2
function destroypara() cadoulabel(),DestroyObject(parazburator),SCMTA(COLOR_DEPART, "(Gift Box) Obiectul a aterizat cu succes!");

// update 3dtextlabel info3
function cadoulabel() {
	if(cadoumort == 1) return 1;
	new string[100],Float:X,Float:Z,Float:Y;
	if(cadoulbl == 0) GetObjectPos(cadouzburator, X,Y,Z),format(string, sizeof(string), "CADOU LEVEL {ff0000}%d{ffffff}\nHP: {ff0000}%d",cadoulevel,cadouviata),Cadolabel = CreateDynamic3DTextLabel(string, -1, X,Y,Z+1.5, 50, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0, -1, -1, 500.0),cadoulbl = 1;
	if(cadoulbl == 1) format(string, sizeof(string), "CADOU LEVEL {ff0000}%d{ffffff}\nHP: {ff0000}%d",cadoulevel,cadouviata),UpdateDynamic3DTextLabelText(Cadolabel, -1, string);
	return 1;
}
// update textdraw and progresbar info 4
function updatecadoubar(playerid) {
	if(cadoumort == 1) PlayerTextDrawHide(playerid, cadouzburatorPTD[0]),DestroyPlayerProgressBar(playerid, cadouBAR[playerid]),cadoulqw[playerid] = 0;
	new Float:X,Float:Y,Float:Z;GetObjectPos(cadouzburator, X,Y,Z);
	if(!PlayerToPoint(115.0, playerid, X,Y,Z)) return PlayerTextDrawHide(playerid, cadouzburatorPTD[0]),DestroyPlayerProgressBar(playerid, cadouBAR[playerid]),cadoulqw[playerid] = 0;
	new string[100];
	if(cadouviata > 999) format(string,sizeof(string)," Cadou level ~r~%d~w~~n~  HP: ~r~%d~w~/%d",cadoulevel,cadouviata,cadouviatai),PlayerTextDrawSetString(playerid, cadouzburatorPTD[0], string),PlayerTextDrawShow(playerid, cadouzburatorPTD[0]);
	if(cadouviata < 1000) format(string,sizeof(string),"Cadou level ~r~%d~w~~n~ HP: ~r~%d~w~/%d",cadoulevel,cadouviata,cadouviatai),PlayerTextDrawSetString(playerid, cadouzburatorPTD[0], string),PlayerTextDrawShow(playerid, cadouzburatorPTD[0]);
	if(cadoulqw[playerid] == 0) { cadouBAR[playerid] = CreatePlayerProgressBar(playerid,265.00, 411.00, 131.50, 21.20, 16711935, 100.0), SetPlayerProgressBarMaxValue(playerid, cadouBAR[playerid], cadouviatai),cadoulqw[playerid] = 1; } else { SetPlayerProgressBarValue(playerid, cadouBAR[playerid], cadouviata),ShowPlayerProgressBar(playerid, cadouBAR[playerid]); }
	return 1;
}
// comanda pentru afisarea tuturor participantilor info 5
CMD:topevent(playerid, params[]) {
	if(cadoumort == 0) return SCM(playerid, -1, "(Gift Box) Inca nu a fost distrus cadoul!");
	SCM(playerid, COLOR_MONEY, "------Participanti la event------");
	foreach(new i : Player) if(dmgdat[i] >= 1) SCMF(playerid, COLOR_MONEY, "%s (%d) - %s damage - [%s pp, %s rp, $%s]", GetName(i),i,FormatNumber(dmgdat[i]),FormatNumber(cadoupp[i]),FormatNumber(cadourp[i]),FormatNumber(cadoubani[i]));
	SCM(playerid, COLOR_MONEY, "---------------------------------------");
	return 1;
}

// comanda pentru colectarea premiului info 6
CMD:collectgift(playerid, params[]) {
	if(cadoumort == 0) return SCM(playerid, -1, "(Gift Box) Inca nu a fost distrus cadoul!");
	if(cadoubani[playerid] <= 0) return SCM(playerid, -1, "Nu ai participat la acest event!");
	if(colectgf[playerid] == 1) return 1;
	new Float:pos[3];GetObjectPos(collectobject, pos[0],pos[1],pos[2]);
    if(!IsPlayerInRangeOfPoint(playerid, 10, pos[0],pos[1],pos[2])) return SCM(playerid, COLOR_WARNING, "(Gift Box) Trebuie sa fii in apropierea saculetului galben.");
	new string[100];
	format(string, sizeof(string), "%s (%d) - %s damage - [$%s, %s pp, %s rp]\n", GetName(playerid),playerid,FormatNumber(dmgdat[playerid]),FormatNumber(cadoubani[playerid]),FormatNumber(cadoupp[playerid]),FormatNumber(cadourp[playerid]));
	ShowPlayerDialog(playerid, DIALOG_COLLECTCADOU, DIALOG_STYLE_LIST,"Gift Collect", string, "Collect", "");
	return 1;
}
// comanda pentru spawnarea cadoului info 7
CMD:dropgift(playerid, params[]) {
	if(strlen(PlayerInfo[playerid][pPin]) != 0 && PlayerInfo[playerid][pPinLogged] == 0) {
		 SendClientMessage(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda deoarece nu te-ai autentificat cu codul de securitate.");
		 SendClientMessage(playerid, COLOR_GREY, "Pentru a te autentifica, foloseste comanda '/loginpin'!");
		 return 1;
	}
	if(PlayerInfo[playerid][pAdmin] < 6) return 1;
	if(cadoumort == 0) return SCM(playerid,-1,"Este deja un event in desfasurare! [cadou]");
	cadouzb();
	return 1;
}
// comanda pentru a te telporta la cadou info 8
CMD:gotocadou(playerid, pamars[]) {
	if(strlen(PlayerInfo[playerid][pPin]) != 0 && PlayerInfo[playerid][pPinLogged] == 0) {
		 SendClientMessage(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda deoarece nu te-ai autentificat cu codul de securitate.");
		 SendClientMessage(playerid, COLOR_GREY, "Pentru a te autentifica, foloseste comanda '/loginpin'!");
		 return 1;
	}
	if(PlayerInfo[playerid][pAdmin] < 6) return 1;
	if(cadoumort == 1) return SCM(playerid,-1,"Nu este nici un event in desfasurare! [cadou]");
	new Float:X,Float:Y,Float:Z;GetObjectPos(cadouzburator, X, Y, Z),SetPlayerPos(playerid, X, Y+3, Z),SetPlayerInterior(playerid, 0),SetPlayerVirtualWorld(playerid,0);
	return 1;
}

de adugat la onplayerconnect

        cadouzburatorPTD[0] = CreatePlayerTextDraw(playerid, 287.733306, 380.840728, "HP:_22/500");
 	PlayerTextDrawLetterSize(playerid, cadouzburatorPTD[0], 0.270333, 1.608296);
	PlayerTextDrawAlignment(playerid, cadouzburatorPTD[0], 1);
	PlayerTextDrawColor(playerid, cadouzburatorPTD[0], -1);
	PlayerTextDrawSetShadow(playerid, cadouzburatorPTD[0], 0);
	PlayerTextDrawSetOutline(playerid, cadouzburatorPTD[0], 1);
	PlayerTextDrawBackgroundColor(playerid, cadouzburatorPTD[0], 255);
	PlayerTextDrawFont(playerid, cadouzburatorPTD[0], 2);
	PlayerTextDrawSetProportional(playerid, cadouzburatorPTD[0], 1);
	PlayerTextDrawSetShadow(playerid, cadouzburatorPTD[0], 0);

Informatii:

 

info functia random (Ex) : random(5) = 0,1,2,3,4. functia nu ajunge pana la numarul 5.
 
info 1: pentru inceput creăm 2 variabile doarece doarece cadoul are 3 nivele si 3 locatii de spawn
creăm un obiect intr-un loc de spawn ales prin functia random din cele 3 locuri
facem obiectul sa se miste
Atasam o parasuta si o animatie cu foc de cadou
setam viata cadoului in functie de nivelul ales prin functia random
resetam variabilele acum, deoarece ne trebuie pentru comanda /topevent si nu le putem reseta la distrugerea obiectului
activam un timer care anunta cand cadoul ajunge la pamant
distrugem obiectul si textul pentru /collectgift
 
info 2: pentru inceput updatam text-ul cadoului
  distrugem parasuta
  trimitem mesajul prin care obiectul a aterizat
 
info 3: pentru inceput verificam daca cadoului este spawnat sau nu
creăm niste variabile
verificam daca text-ul cadoului este creat si il creăm, daca este creat doar il updatam
 
info 4: daca cadoul este mort distrugem textdrawul si progresbarul
creăm niste variabile si luam coordonatele cadoului
verificam daca cadoul are un anumit numar de hp, am facut acea verificare pentru aspect
aratam textdrawul jucatorului
verificam daca playerul are un progresbar creat si il creăm, daca il are creat doar il updatam
 
info 5: aceasta comanda este folosita pentru a arata participantii eventului prin stock-ul scmf
 
info 6: aceasta comanda o folosim pentru colectarea premiului dupa distrugerea cadoului
 
info 7: aceasta comanda o folosim pentru spawnarea cadoului
 
info 8: aceasta comanda o folosim pentru a te teleporta la cadou
 
info 9: pentru inceput verificam daca trage in obiect cu armele scrise acolo
           fiecare hit o sa fie de 5 dmg, si o sa primesti 250$ pe hit, updatam textdraw-ul si labelul tuturor la fiecare hit
           Daca cadoul are 0 hp sau mai putin se schimba 3dtext-ul si se creeaza un obiect pentru /collectgift
           se verifica daca playerul are peste 500 dmg si o primeasca ceva in plus
           se anunta tutoror participantiilor ca se poate folosii /collectgift
           se distrug obiectele si textele
 
 
 
Sistemul este ok si nu o consume mai nimic din server.
Pentru orice fel de erori sau neintelegeri astept pm sau reply la topic. 
Scuze pentru exprimare.

 

 

cine nu se descurca cu SCMF, nu va mai complicatii

 

CMD:topevent(playerid, params[]) {

    if(cadoumort == 0) return SCM(playerid, -1, "(Gift Box) Inca nu a fost distrus cadoul!");

    SCM(playerid, COLOR_MONEY, "------Participanti la event------");

    foreach(new i : Player) if(dmgdat >= 1) {

    new string[128];

    format(string, sizeof(string), "%s (%d) - %s damage - [%s pp, %s rp, $%s]",                    GetName(i),i,FormatNumber(dmgdat),FormatNumber(cadoupp),FormatNumber(cadourp),FormatNumber(cadoubani));

    SCM(playerid,-1,string);

    }

    SCM(playerid, COLOR_MONEY, "---------------------------------------");

    return 1;

}

 

pentru cei care nu reusesc sa puna y_timers

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...