Jump to content
  • 0

Serverul pica


Alex_SuspanS

Question

Am rezolvat problema din topicul anterior cand pica asa pur si simplu fara sa fac nmk

Acm cand scriu pe /cnn(este un gamemode roleplay) sau /o sau /am sau anumite comenzi uneori sa inchide(nu este de la host pentru ca si pe windows mai face asa) 

Este clar ca e din gamemode problema dar daca imi putei spune de la ce este daca imi puteti spunde ce la ce pica cand scriu anumite comenzi si uneori cade v-asi fi recunoscator! (tin sa mentionez ca am adugat recent niste comenzi noi si am multe warninguri gen 98-103 parca si are anticheat...poate o fi de la el dar eu cred ca este de la warninguri..CRED) de regula cand se apropie momentul cand se inchide sv se face lag 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Probabil la cnn ai exact aceasta chestie care am specificat-o eu

Astazi am invatat ca niste comenzi aparent simple pot afecta grav serverul. Comanda de genul cnn este daunatoare pentru playerii de samp, aceasta poate da crash la server(sa il inchida).

 

Aceasta fiind comanda:

CMD:cnn(playerid,params[])
{
    if(gLogged[playerid] != 1) return SCM(playerid,COLOR_RED,"Nu esti logat");
	if (PlayerInfo[playerid][pAdmin] < 2) return SCM(playerid, COLOR_GRAD1, "   Nu ai rangul administrativ necesar!");
	new message[128],txtid;
	if(sscanf(params,"ds[128]",txtid,message)) return SCM(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /cnn [0-8]   [textformat ~n~ Newline, ~r~ Red, ~g~ Green, ~b~ Blue, ~w~ White, ~y~, Yellow]");
 	format(strings, sizeof(strings), "~b~ %s: ~n~~w~%s",PlayerName(playerid),message);
	foreach(Player,i)
  	GameTextForPlayer(i, strings, 5000, txtid);//
	return 1;
}

Daca scriem "/cnn 0 ~n~~n~~r~ Salut" 

Stilul 0 acel "txtid" adica de la GameText, Poate restarta serverul.

De ce?

Pentru ca adminii vor sa afiseze un mesaj in culori sa dea bine, iar gametextele care suporta tagurile ~n~~r~ de culoare si spatiu sunt 3,4 si 5.

Probabilitatea ca adminul sa nimereasca aceste texte e mica. In concluzie serverul va pica si vom avea in server log erorile.

 

[14:45:57] [debug] Run time error 6: "Invalid instruction"
[14:45:57] [debug]  Unknown opcode 0x290000 at address 0x0000007E
[14:45:57] [debug] AMX backtrace:
[14:45:57] [debug] #0 00000000 in public cmd_cnn () from gamemode.amx
[14:45:57] [debug] #1 native LIFECMD () from LIFE-CMD.DLL
[14:45:57] [debug] #2 00000000 in public OnPlayerCommandText () from gamemode.amx
[14:45:57] [debug] Run time error 6: "Invalid instruction"
[14:45:57] [debug]  Unknown opcode 0x3000 at address 0x00000073
[14:45:57] [debug] AMX backtrace:
[14:45:57] [debug] #0 00000000 in public OnPlayerCommandText () from gamemode.amx

 

Serverul va fi restartat si de acea va trebui sa schimbam comanda si sa ii punem restrictii

 

CMD:cnn(playerid,params[])
{
    if(gLogged[playerid] != 1) return SCM(playerid,COLOR_RED,"Nu esti logat");
	if (PlayerInfo[playerid][pAdmin] < 2) return SCM(playerid, COLOR_RED, "   Nu ai rangul administrativ necesar!");
	new message[128],txtid;
	if(sscanf(params,"ds[128]",txtid,message)) return SCM(playerid, COLOR_RED, "{00FF00}Folosire:{FFFFFF} /cnn [3-5]   [textformat ~n~ Newline, ~r~ Red, ~g~ Green, ~b~ Blue, ~w~ White, ~y~, Yellow]");
    if(txtid != 3 && txtid != 4 && txtid !=5) return SCM(playerid,COLOR_RED,"Atentie Formatul trebuie sa fie 3,4 sau 5!");
 	format(strings, sizeof(strings), "~b~ %s: ~n~~w~%s",PlayerName(playerid),message);
	foreach(Player,i)
  	GameTextForPlayer(i, strings, 5000, txtid);//
	return 1;
}

 

Conținut ascuns

Sper ca nu e ceva gresit, sau am postat gresit.

 

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
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.