IstuntmanI Posted June 26, 2011 Report Share Posted June 26, 2011 Cum sa blochezi comenzile intr-o zonaTutorial creat de [sRC]stuntman (eu)Cerut de Roach: http://www.sa-mp.ro/forum/index.php/topic,13121.msg80048.html#msg80048Sa incepem:1. Ca sa creezi variabila care va retine daca esti in acea zona, pui in varful scriptului:new IsPlayerInZone[ MAX_PLAYERS ]; MAX_PLAYERS - aceasta se va inlocui in functii cu 'playerid' . 2. Ca sa setezi variabila la 1, asta insemnand ca a intrat in acea zona, punem undeva, intr-o comanda ( de exemplu ), asta: IsPlayerInZone[ playerid ] = 1; playerid - acesta este ID-ul jucatorului caruia ii va seta respawnarea. 1 - arata ca jucatorul a intrat in acea zona si ca nu mai poate folosi nici o comanda. 3. Ca sa faceti sa nu mai poata folosi decat cateva comenzi in acea zona, sau deloc, adaugati acestea la OnPlayerCommandText ( explicatiile sunt trecute la sfarsitul linie cu // ): if( IsPlayerInZone[ playerid ] == 1 && strcmp(cmdtext, "/exitzone", true) != 0 ) //aici verifica daca jucatorul este in acea zona si daca nu scrie '/exitzone', daca vreti mai multe comenzi care sa mearga scrise, adaugati dupa && asta: strcmp(cmdtext, "/exitzone", true), adaugati dupa , true) un &&, iar apoi schimbati comanda '/exitzone' cu cea pe care o vreti, daca vreti fara comenzi permise, scoateti de la && ( inclusiv && )pana la ) return SendClientMessage( playerid, 0xFF0000FF, "EROARE: {FFFFFF}Nu poti iesi din aceasta zona, foloseste /exitzone !" ); //aici trimite mesajul ca nu poate iesi din acea zona si ca trebuie sa foloseasca /exitzone ca sa iasa din ea 4. Ca sa punem ca la /exitzone ( de exemplu ) sa iasa din acea zona, adaugam asta in comanda /exitzone: IsPlayerInZone[ playerid ] = 0; //nu modificati, 1 = este in acea zona si nu poate folosi nici o comanda, 0 = nu este in acea zona si poate folosi orice comanda 5. Ca sa nu avem buguri cand se spawneaza un jucator nou conectat, pune la OnPlayerConnect asta: IsPlayerInZone[ playerid ] = 0; //daca un jucator cu acelasi ID de dinainte iesise de pe server cand era in acea zona, pe noul jucator cu acelasi ID nu-l va fi lasat sa scrie vreo comanda, decat /exitzone pentru ca "era" in acea zonaPS: Se poate face si daca este intr-o zona ( fara comanda ) ca jucatorul sa nu poata folosi comenzile, decat cele specificate, in loc de IsPlayerInZone de la o comanda ( punctul 2 ), se pune la OnPlayerUpdate, folosit impreuna cu IsPlayerInRangeOfPoint si alte functii pentru zona. Quote Link to comment Share on other sites More sharing options...
Ryder_RO Posted June 26, 2011 Report Share Posted June 26, 2011 Bravo stuntman frumos tutorial..5/5 Quote Link to comment Share on other sites More sharing options...
xxSPEEDYxx Posted June 26, 2011 Report Share Posted June 26, 2011 bv stuntman inca un tut bun de al tau:P 5/5:D Quote Fara reclama in semnatura! Link to comment Share on other sites More sharing options...
vampir_MD Posted June 26, 2011 Report Share Posted June 26, 2011 Bun tutorial 5/5 Quote Link to comment Share on other sites More sharing options...
ruben88 Posted June 26, 2011 Report Share Posted June 26, 2011 Tare! :D Quote Link to comment Share on other sites More sharing options...
Don.Capone Posted June 26, 2011 Report Share Posted June 26, 2011 nice 5/5 Quote I'm back haha ! Link to comment Share on other sites More sharing options...
NeKeRm@N Posted June 26, 2011 Report Share Posted June 26, 2011 frumos 5/5 Quote Link to comment Share on other sites More sharing options...
Roach Posted June 26, 2011 Report Share Posted June 26, 2011 Misto, stunt... Asa te vreau )) 5/5 Quote Underground-GFX Link to comment Share on other sites More sharing options...
Eazy Posted June 26, 2011 Report Share Posted June 26, 2011 Bun tutorialul asta 5/5 Quote Cumpar sistem de garaje , /pmProprietar Xerom Zone Link to comment Share on other sites More sharing options...
[.E.m.O.]K1DDU Posted June 26, 2011 Report Share Posted June 26, 2011 Bravo StuntMan xD 10/10, chiar aveam azi nevoie de asa ceva, eram pregatit sa fac mai tarziu o cerere cu asa ceva , bravo. Si mersi! Quote F*ck everybody who want and who try to judge me for who I am, b*star*s ! Follow me on: Facebook.com TSU.co Twitter.com Instagram.com Youtube.com Google+ Link to comment Share on other sites More sharing options...
[RDE]Secret Posted June 27, 2011 Report Share Posted June 27, 2011 gj..5/5 xD Quote youtube.com/secretofficial1 < - SECRET CHANNEL ! Link to comment Share on other sites More sharing options...
XpLoD Posted June 28, 2011 Report Share Posted June 28, 2011 foarte bun tutorial 5/5 Quote Link to comment Share on other sites More sharing options...
[STR]Toretto Posted June 29, 2011 Report Share Posted June 29, 2011 Super! 10/10 Quote Link to comment Share on other sites More sharing options...
shaun Posted July 2, 2011 Report Share Posted July 2, 2011 Super no comment ! SI IN + AI CEA MAI TARE SEMNATURA DIN LUME ! CUM AI FACUTO?:O Quote CHECK MY CHANNEL!http://www.youtube.com/user/amysoica Link to comment Share on other sites More sharing options...
Deejaybwg Posted August 11, 2011 Report Share Posted August 11, 2011 Tutorial - 5/5. Quote www.youtube.com/thebwgg Link to comment Share on other sites More sharing options...
bcretu64 Posted September 2, 2011 Report Share Posted September 2, 2011 gj 5/5 foarte folositor ;) Quote Link to comment Share on other sites More sharing options...
PawnFox Posted December 19, 2011 Report Share Posted December 19, 2011 Scuze de bump , dar , daca folosesc zcmd , unde pun ?[pawn]if( IsPlayerInZone[ playerid ] == 1 && strcmp(cmdtext, "/exitzone", true) != 0 ) //aici verifica daca jucatorul este in acea zona si daca nu scrie '/exitzone', daca vreti mai multe comenzi care sa mearga scrise, adaugati dupa && asta: strcmp(cmdtext, "/exitzone", true), adaugati dupa , true) un &&, iar apoi schimbati comanda '/exitzone' cu cea pe care o vreti, daca vreti fara comenzi permise, scoateti de la && ( inclusiv && )pana la ) return SendClientMessage( playerid, 0xFF0000FF, "EROARE: {FFFFFF}Nu poti iesi din aceasta zona, foloseste /exitzone !" ); //aici trimite mesajul ca nu poate iesi din acea zona si ca trebuie sa foloseasca /exitzone ca sa iasa din ea[/pawn] Scuze inca odata de bump ? Quote 94.23.120.101:7778 Link to comment Share on other sites More sharing options...
Gireada Posted December 19, 2011 Report Share Posted December 19, 2011 Good Good 5/5 Quote Link to comment Share on other sites More sharing options...
SiNuS Posted December 19, 2011 Report Share Posted December 19, 2011 Folositor 5/5 , la mai multe :P Quote Link to comment Share on other sites More sharing options...
PawnFox Posted December 19, 2011 Report Share Posted December 19, 2011 Scuze de bump , dar , daca folosesc zcmd , unde pun ?[pawn]if( IsPlayerInZone[ playerid ] == 1 && strcmp(cmdtext, "/exitzone", true) != 0 ) //aici verifica daca jucatorul este in acea zona si daca nu scrie '/exitzone', daca vreti mai multe comenzi care sa mearga scrise, adaugati dupa && asta: strcmp(cmdtext, "/exitzone", true), adaugati dupa , true) un &&, iar apoi schimbati comanda '/exitzone' cu cea pe care o vreti, daca vreti fara comenzi permise, scoateti de la && ( inclusiv && )pana la ) return SendClientMessage( playerid, 0xFF0000FF, "EROARE: {FFFFFF}Nu poti iesi din aceasta zona, foloseste /exitzone !" ); //aici trimite mesajul ca nu poate iesi din acea zona si ca trebuie sa foloseasca /exitzone ca sa iasa din ea[/pawn] Scuze inca odata de bump ?mi-am dat seama ca trebuie pus la: [pawn]public OnPlayerCommandPerformed(playerid, cmdtext[], success)[/pawn]Am asa:[pawn]public OnPlayerCommandPerformed(playerid, cmdtext[], success){ if( IsPlayerInFC[ playerid ] == 1 && strcmp(cmdtext, "/exitfc", true) && strcmp(cmdtext, "/refill", true) && strcmp(cmdtext, "/me", true) && strcmp(cmdtext, "/leavefc", true)&& strcmp(cmdtext, "/sync", true) != 0 ) return SendClientMessage( playerid, COLOR_RED, "ERROR:You can't use this command because you are in a DM Zone. Use first /exit or /leave." ); return 0;}[/pawn]De exemplu daca scriu /help , imi arata "ERROR:you can't .. " dar imi arata dialogul , sau de exemplu /countdown , imi arata eroarea , dar Countdown-ul porneste , cum pot rezolva?. Quote 94.23.120.101:7778 Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.