Jump to content
  • 0

[0.3c-Help]CMD Problem :((


onix09

Question

Am si eu un server si vreau sa semene cu un server(nu fac reclama)si la dialogul /cmds chiar numi iese am incercat sa fac doardn 2 lini cu \n....si toate alea dar nu mia iesit deci...va rog, nu ma ajutati :)) daca se poate sa mil faceti voi :| nu prea le am cu scriptul....ce stiu sa fac e un Fighting Styles....dar la dialog imi da dont send :| de ce ajutatima cum pot face si eu dialogul acesta:


    if(strcmp(cmdtext, "/cmds", true) == 0)
    {
    ShowPlayerDialog(playerid,c,DIALOG_STYLE_MSGBOX,"{00C0FF}Comenzi","\n{F81414}->/v {0049FF}- {FFFFFF}Foloseste comanda {F81414}/v {FFFFFF}pentru ati alege masina favorita!\n{F81414}->/arme {0049FF}- {FFFFFF}Foloseste comanda {F81414}/arme {FFFFFF}pentru a cumapra arme de aparare!\n{F81414}->/teles {0049FF}- {FFFFFF}Foloseste comanda {F81414}/teles {FFFFFF}pentru a vedea teleportarile disponibile\n\
	{FFFFFF}/Int /Barme /Givecash /Lock /Skin\n/nrg /unlock /gps [id/off] /s /zi\n\
	{FFFFFF}/noapte /lottohelp /vup /afk /brb\n/happy /credits /piss /teles /web\n\
	{FFFFFF}/tigara /vin /anims /para /sad\n/tune /fumez /ad /sweaps /case /dm /jump\n\
	{FFFFFF}/up /rampon /rampoff /buyscore /ochelari\n/cmenu /stopsmoke /b /v /plantbomb\n\
	{FFFFFF}/detonate /maze /exitmaze /neonshop /bizhelp\n/vControl /stunt /races /altele\n\
	{FFFFFF}Cand esti intr-un vehicul {F3FF02}Apasa {F81414}2 {FFFFFF}pentru a repara masina si {F81414}Click {FFFFFF}pentru a pune nitro!","OK","");
    return 1;
    }

9zZndmN.png
Link to comment
Share on other sites

22 answers to this question

Recommended Posts

Guest RockStar

Incearca sa faci ceva de genu

if(strcmp(cmdtext, "/numecmd", true) == 0)
    {
    ShowPlayerDialog(playerid,dialogname,DIALOG_STYLE_MSGBOX,"text","text\ntext\n \
        \n text \n\
	\n text \n\
	\n text \n\
	\n text \n\
	\n text \n\
	\n text ","OK","Cancel");
    }

Nu am testat dar ar trebui sa mearga ;)

Edit : incearca din nou ca uitasem eu sa pun ceva la sfarsit :))

Link to comment
Share on other sites

Voi incerca, revin cu edit :D Edit: a ce e cu ok..;)) vo reveni cu edit :D

Edit: tot dont send imi da si am facut doar asa

	if(strcmp(cmdtext, "/cmdtest", true) == 0)
    {
    ShowPlayerDialog(playerid,ct,DIALOG_STYLE_MSGBOX,"{00C0FF}Comenzile serverului {F81414}The-Darkness","{F81414}->/v {0049FF}- {FFFFFF}Foloseste comanda {F81414}/v {FFFFFF}pentru ati alege masina favorita!\n{F81414}->/arme {0049FF}- {FFFFFF}Foloseste comanda {F81414}/arme {FFFFFF}pentru a cumapra arme de aparare!\n{F81414}->/teles {0049FF}- {FFFFFF}Foloseste comanda {F81414}/teles {FFFFFF}pentru a vedea teleportarile disponibile\n \
        \n {FFFFFF}/Int /Barme /Givecash /Lock /Skin\n/nrg /unlock /gps [id/off] /s /zi\n\
   \n text \n\
   \n text \n\
   \n text ","OK","Cancel");
    }

9zZndmN.png
Link to comment
Share on other sites

   if(strcmp(cmdtext, "/cmdtest", true) == 0)
    {
    ShowPlayerDialog(playerid,ct,DIALOG_STYLE_MSGBOX,"{00C0FF}Comenzile serverului {F81414}The-Darkness","{F81414}->/v {0049FF}- {FFFFFF}Foloseste comanda {F81414}/v {FFFFFF}pentru ati alege masina favorita!\n{F81414}->/arme {0049FF}- {FFFFFF}Foloseste comanda {F81414}/arme {FFFFFF}pentru a cumapra arme de aparare!\n{F81414}->/teles {0049FF}- {FFFFFF}Foloseste comanda {F81414}/teles {FFFFFF}pentru a vedea teleportarile disponibile\n \
        \n {FFFFFF}/Int /Barme /Givecash /Lock /Skin\n/nrg /unlock /gps [id/off] /s /zi\n\
  \n text \n\
  \n text \n\
  \n text ","OK","Cancel");
    return 1;
    }

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Link to comment
Share on other sites

Guest RockStar

Am bagat in gm meu cmd aia si ai dreptate da don't send dar din ce cauza , orice string are o limita si tu ai depasito la linia asta

ShowPlayerDialog(playerid,ct,DIALOG_STYLE_MSGBOX,"{00C0FF}Comenzile serverului {F81414}The-Darkness","{F81414}->/v {0049FF}- {FFFFFF}Foloseste comanda {F81414}/v {FFFFFF}pentru ati alege masina favorita!\n{F81414}->/arme {0049FF}- {FFFFFF}Foloseste comanda {F81414}/arme {FFFFFF}pentru a cumapra arme de aparare!\n{F81414}->/teles {0049FF}- {FFFFFF}Foloseste comanda {F81414}/teles {FFFFFF}pentru a vedea teleportarile disponibile\n \

Incearca sa o faci mai mica si nu o sa iti dea eroare ;)

Link to comment
Share on other sites

=-" post="55066" timestamp="1297872695"]

   if(strcmp(cmdtext, "/cmdtest", true) == 0)
    {
    ShowPlayerDialog(playerid,ct,DIALOG_STYLE_MSGBOX,"{00C0FF}Comenzile serverului {F81414}The-Darkness","{F81414}->/v {0049FF}- {FFFFFF}Foloseste comanda {F81414}/v {FFFFFF}pentru ati alege masina favorita!\n{F81414}->/arme {0049FF}- {FFFFFF}Foloseste comanda {F81414}/arme {FFFFFF}pentru a cumapra arme de aparare!\n{F81414}->/teles {0049FF}- {FFFFFF}Foloseste comanda {F81414}/teles {FFFFFF}pentru a vedea teleportarile disponibile\n \
        \n {FFFFFF}/Int /Barme /Givecash /Lock /Skin\n/nrg /unlock /gps [id/off] /s /zi\n\
   \n text \n\
   \n text \n\
   \n text ","OK","Cancel");
    return 1;
    }
Esti Moderator nu Scripter, lasa-te de jobu asta. Angel trebuie sa folosesti un "streamer" cum s-ar zice, pentru ca depasirea marimii de 500 - 800 de caractere parca intr-un string, duce la eroare chiar si crash in pawn. Trebuie sa faci asa.
//Sus de tot
new BigString[ 1024 ];
forward ConcatenateStrings( );

//In comanda ta
ShowDialogForPlayer( playerid, ct, DIALOG_STYLE_MSGBOX, ConcatenateStrings( ), "Ok", "Close" );

//Jos de tot
public ConcatenateStrings( )
{
    strcat(BigString, "Mult text aici\n", 1024 );
    strcat(BigString, "Mult text aici 2\n", 1024 );
    strcat(BigString, "Mult text aici 3\n", 1024 );
    strcat(BigString, "Mult text aici 4\n", 1024 );
    strcat(BigString, "Mult text aici 5\n", 1024 );
    return BigString;
}

Codul l-am facut live aici pe forum ca na-m avut timp sa deschid pawn, s-ar putea sa dea erori, anunta-ma.

Link to comment
Share on other sites

EDIT: Zh3r0 scuze nam vazut k ai postat si tu voi incerca si dak merge esti cel mai tare xD

Deci nu a mers si am vb cu rock si am incercat si altelf dar knd fak asa nu mai merge nici o comanda :|

	if (strcmp("/cmds", cmdtext, true, 10) == 0)
    {
	new string[700], sL[600], sI[600], sU[500], sQ[500], sT[128], sM[600], sR[600], sG[600], sK[600], sE[70];
	format(sL, sizeof(sL), "{F81414}->/v {0049FF}- {FFFFFF}Foloseste comanda {F81414}/v {FFFFFF}pentru ati alege masina favorita!");
	format(sI, sizeof(sI), "{F81414}->/arme {0049FF}- {FFFFFF}Foloseste comanda {F81414}/arme {FFFFFF}pentru a cumapra arme de aparare!");
    format(sU, sizeof(sU), "{F81414}->/teles {0049FF}- {FFFFFF}Foloseste comanda {F81414}/teles {FFFFFF}pentru a vedea teleportarile disponibile");
    format(sQ, sizeof(sQ), "");
    format(sT, sizeof(sT), "{FFAF00}Alte Comenzi:");
    format(sE, sizeof(sE), "{FFFFFF}/Int /Barme /Givecash /Lock /Skin /nrg /unlock /gps [id/off] /s /zi");
    format(sR, sizeof(sR), "{FFFFFF}/noapte /lottohelp /vup /afk /brb /happy /credits /piss /teles /web");
    format(sK, sizeof(sK), "{FFFFFF}/tigara /vin /anims /para /sad /tune /fumez /ad /sweaps /case /dm /jump");
    format(sG, sizeof(sG), "{FFFFFF}/up /rampon /rampoff /buyscore /ochelari /cmenu /stopsmoke /b /v /plantbomb");
    format(sM, sizeof(sM), "{FFFFFF}/detonate /maze /exitmaze /neonshop /bizhelp /vControl /stunt /races /altele");
 	format(string, sizeof(string),"{FFFFFF}Cand esti intr-un vehicul {F3FF02}Apasa {F81414}2 {FFFFFF}pentru a repara masina si {F81414}Click {FFFFFF}pentru a pune nitro!",sL,sI,sU,sQ,sT,sE,sR);
    return ShowPlayerDialog(playerid, 1010, 0, "General Commands", string, "Ok", "Cancel");
    }
    return 1;
    }

9zZndmN.png
Link to comment
Share on other sites

Cea ce faci tu acolo este cea mai mare prostie! Foarte mare prostie.

Ce am postat eu mere, mere chiar bine si e si mai rapid decat ce incerci tu..

Modelu ala sigurat este al lui Runix ca nu pot sa inteleg cine ar face o asa prostie.

Zici ca nu mere? Atunci ce da? Eroare?

Link to comment
Share on other sites

comanda:

if(strcmp(cmdtext, "/telesx", true) == 0)
{
	ShowPlayerDialog( playerid, 9046, DIALOG_STYLE_MSGBOX, ConcatenateStrings( ), "Ok", "Close" );
	return 1;
}
Eroare:
(2710) : error 035: argument type mismatch (argument 4)

2710 este cel cu ShowPlayerDialog.  :sad: ce sa fac?

Link to comment
Share on other sites

comanda:

if(strcmp(cmdtext, "/telesx", true) == 0)
{
	ShowPlayerDialog( playerid, 9046, DIALOG_STYLE_MSGBOX, ConcatenateStrings( ), "Ok", "Close" );
	return 1;
}
Eroare:
(2710) : error 035: argument type mismatch (argument 4)

2710 este cel cu ShowPlayerDialog.  :sad: ce sa fac?

Schimba id acelui dialog , pentru ca intra in conflict cu alt dialog.

Link to comment
Share on other sites

Voi face ce zice Zh3r0, revin cu edit xD abea astept sa vad dak merge  :evil:

EDIT: Nu merge am 2 erori :((

**********(2812) : warning 202: number of arguments does not match definition

**********(12799) : error 090: public functions may not return arrays (symbol "ConcatenateStrings")

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Linia 2812:    ShowPlayerDialog(playerid,c,DIALOG_STYLE_MSGBOX, ConcatenateStrings( ), "Ok", "Close" )

Linia 12799:    return BigString;

PS: Exteme...cum o fi iote ce trebvuie sa faci:

1. Dute sus la gm si a #defineuri baga #define test 45

2. la showplayer dialog in lok de 4095 sau cum era baga test :D

9zZndmN.png
Link to comment
Share on other sites

Dar de ce nu faci fiecare rand un string, iar apoi faci un string mai mare cu celalte stringuri ? Apoi sa-l bagi in dialog?

Eu unul nu sunt un mare fan al functiilor kre pot fii inlocuite printr o simpla chestie, cum ar fii mai multe string-uri.

-Toate tutorialele postate intra aici sau puneti-le direct [url=http://www.sa-mp.ro/forum/index

Link to comment
Share on other sites

AngeL=-" post="55146" timestamp="1297938265"]

Voi face ce zice Zh3r0, revin cu edit xD abea astept sa vad dak merge  :evil:

EDIT: Nu merge am 2 erori :((

**********(2812) : warning 202: number of arguments does not match definition

**********(12799) : error 090: public functions may not return arrays (symbol "ConcatenateStrings")

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Linia 2812:    ShowPlayerDialog(playerid,c,DIALOG_STYLE_MSGBOX, ConcatenateStrings( ), "Ok", "Close" )

Linia 12799:    return BigString;

PS: Exteme...cum o fi iote ce trebvuie sa faci:

1. Dute sus la gm si a #defineuri baga #define test 45

2. la showplayer dialog in lok de 4095 sau cum era baga test :D

Aceeasi eroare... imi da , am facut ce ai zis.

Link to comment
Share on other sites

Dar de ce nu faci fiecare rand un string, iar apoi faci un string mai mare cu celalte stringuri ? Apoi sa-l bagi in dialog?

Eu unul nu sunt un mare fan al functiilor kre pot fii inlocuite printr o simpla chestie, cum ar fii mai multe string-uri.

ma tot zik mereu, nus scripter :| nu am inteles nik din ce ai zis :|

9zZndmN.png
Link to comment
Share on other sites

Toti de aici care ati postat sunteti varza.

Nu e bine ce ai facut tu

ShowPlayerDialog( playerid, 9046, DIALOG_STYLE_MSGBOX, ConcatenateStrings( ), "Ok", "Close" );
Ai uitat de title[], adica de stringu ala unde vine tiltu. Daca ai vedea mai bine, ti-a dat Argumet type mismatch (argumet 4) adica trebuia ceva dupa a 4 a ',' (virgula). Trebuia asa
ShowPlayerDialog( playerid, 9046, DIALOG_STYLE_MSGBOX,"Title", ConcatenateStrings( ), "Ok", "Close" );
si acuma am facut eu o greseala, scoate forward ConcatenateStrings(); si inloc de public ConcatenateStrings fa asa stock ConcatenateStrings adica inlocuieste 'public' cu 'stock' deoarece functiile public nu pot returna o valenta. rezultatu ar fi
stock ConcatenateStrings()
{
//...codul ala aici
return BigString;
}
Dar, daca ma insel iara, fa direct asa
ConcatenateStrings()
{
//...codul ala aici
return BigString;
}

Link to comment
Share on other sites

Am facut edit cu titlu si am lasat tot mult text aici....acuma bag cum trebuie sa arate /cmds revin cu edit iar dak merge ramaii cel mai tare scripter xD

Edit: Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx Thx A mers xD esti cel mai tare scripter xD dak puteam iti dadeam +1000  Thx Thx Thx Thx Thx Thx esti mai tare ca toti de aici la un lok xD  Thx Thx Thx Thx Thx Thx

9zZndmN.png
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Similar Content

    • By Lwka
      Salutare! Cum pot face o comanda CMD sa fie pe YCMD ?
      CMD:admins(playerid, params[]) { if(GPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "You need to login first."); if(IsPlayerConnected(playerid)) { new string[200],sendername[30]; SendClientMessage(playerid, COLOR_WHITE, "{408080}-----Admins Online------------------------"); foreach(Player,i) { if(IsPlayerConnected(i)) { if(PlayerInfo[pAdmin] == 1) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "{EEEEEE} (%d) %s - Moderator", i, sendername); SendClientMessage(playerid, -1, string); } if(PlayerInfo[pAdmin] == 2) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "{EEEEEE} (%d) %s - Junior Admin", i, sendername); SendClientMessage(playerid, -1, string); } if(PlayerInfo[pAdmin] == 3) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "{EEEEEE} (%d) %s - General Admin", i, sendername); SendClientMessage(playerid, -1, string); } if(PlayerInfo[pAdmin] == 4) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "{EEEEEE} (%d) %s - Senior Admin", i, sendername); SendClientMessage(playerid, -1, string); } if(PlayerInfo[pAdmin] == 5) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "{EEEEEE} (%d) %s - Supervizor", i, sendername); SendClientMessage(playerid, -1, string); } if(PlayerInfo[pAdmin] == 6) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "{EEEEEE} (%d) %s - Detinator", i, sendername); SendClientMessage(playerid, -1, string); } } } SendClientMessage(playerid, COLOR_WHITE, "{408080}--------------------------------------------"); SendClientMessage(playerid, COLOR_WHITE, "Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n."); SendClientMessage(playerid, COLOR_WHITE, "{408080}--------------------------------------------"); } return 1; }  
    • By AndreiSAMP2
      fatal error 111: user error: Did you do <YSI/y_hooks> instead of the required <YSI\y_hooks>?
    • By Георги П.
      Hello friends! Can anyone make me this system to work with dini data recording was done with y_ini and I want to be with dini I did a few attempts but did not help! I would be very grateful! 🙂
       
       
      Biz.pwn
    • By AdrenaLiN
      I want to delete the magnetic crane in San Fierro port but although I use the fuzes map editor, texture studio, map editor tools, I cannot remove the crane object I want to delete. There is a server that can achieve this and I'm curious how they do it. Please help me.
       

    • By DanielSy
      Salutare, sampistiilor. Mai deci am incercat si eu pluginul voicechat de la Cyber Mor, implementat tot frumos. Dar, eu cand bag fisierele cerute in folderul San Andreas nu detecteaza sampvoice.asi. Este o verificare care iti spune daca ai asi-ul sau nu. Iar mie imi zice ca nu l am si nici nu imi arata in joc acel microfon chit ca il am in folder. Am incercat pe modpack, pe gta clean si tot nu merge. Trebie modloader la el? ca am sampfuncs deja... Multumesc seara / ziua buna! ❤️ 
  • Recently Browsing   0 members

    No registered users viewing this page.

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