Jump to content

Cerere Comanda


Mark S.

Recommended Posts

Descriere tutorial: As dori un tutorial de comanda care sa fie ceva de genul:

 

/event [nume event] [nume sponsor] [premiu] [cu masina da/nu]

 

si cand scrie sa afiseze asa:

 

Eventul Deagle este organizat de sponsorul Selby cu premiu de 100k . Cerinte vehicul: NU.

 

 

Nu sunt prea bun la result while si cum se face.

 

Format string alea alea stiu cum e dar nu stiu cum sa faci sa scrie, asa ca am solicitat un tutorial deoarece as dori sa mai fac cate 2 3 comenzi ceva in gen si nu vreau sa postez de fiecare data la "ajutor scripting".

 

Multumesc anticipat

Link to comment
Share on other sites

CMD:event ( playerid , params [ ] )
{
	
		new event[64],sponsor[64],premiu[64],car[64];
		if ( sscanf ( params , "ssis" , event,sponsor,premiu,car ) )
		{
		    SendClientMessage ( playerid , red , "{FF0000}Foloseste /event [ event ] [nume sponsor] [premiu] [cu masina da/nu]" ) ;
		}
		else
		{
			new stri [ 255 ];
			format ( stri , 255 , "Eventul {FF0000}%s este organizat de sponsorul {FF0000}%s cu premiu de {FF0000%s . Cerinte vehicul: {FF0000}%s." ,event,sponsor,premiu,car ) ;
			SendClientMessageToAll(-1, stri);
		}

	return 1;
}
Link to comment
Share on other sites

Salut orice as scrie zice     cu      rosu

 

 

if(strcmp(cmd, "/tipevent", true) == 0)
    {

            new event[64],sponsor[64],premiu[64],car[64];
            if ( sscanf ( cmd , "ssis" , event,sponsor,premiu,car ) )
            {
                SendClientMessage ( playerid , COLOR_RED , "{FF0000}Foloseste /event [ event ] [nume sponsor] [premiu] [cu masina da/nu]" ) ;
            }
            else
            {
                new stri [ 255 ];
                format ( stri , 255 , "Eventul {FF0000}%s este organizat de sponsorul {FF0000}%s cu premiu de {FF0000%s . Cerinte vehicul: {FF0000}%s." ,event,sponsor,premiu,car ) ;
                SendClientMessageToAll(-1, stri);
            }

            return 1;
    }

 

si ce trebuie sa scriu nume sau cifra?

Edited by Selby
Link to comment
Share on other sites

eu olosesc cmdtext si nu merge

if(strcmp(cmd, "/tipevent", true) == 0)
 
    {

            new event[64],sponsor[64],premiu[64],car[64];
            if ( sscanf ( cmd , "ssss" , event,sponsor,premiu,car ) )
            {
                SendClientMessage ( playerid , COLOR_RED , "{FF0000}Foloseste /event [ event ] [nume sponsor] [premiu] [cu masina da/nu]" ) ;
            }
            else
            {
                new stri [ 255 ];
                format ( stri , 255 , "Eventul {FF0000}%s este organizat de sponsorul {FF0000}%s cu premiu de {FF0000%s . Cerinte vehicul: {FF0000}%s." ,event,sponsor,premiu,car ) ;
                SendClientMessageToAll(-1, stri);
            }

            return 1;
    }

   
Edited by Selby
Link to comment
Share on other sites

Schimbi culoarea cu ce culoare vrei tu:

SendClientMessage ( playerid , COLOR_RED , "{FF0000}Foloseste /event [ event ] [nume sponsor] [premiu] [cu masina da/nu]" ) ;

In loc de COLOR_RED pune COLOR_GREY sau ce culori ai tu in gm..

 

 

Link to comment
Share on other sites

adica e ca si cum cere sa mai scriu ce va e incopleta comanda ce trebuie sa scriu /event cifre sau litere

 

orice as scrie face asta

 

if ( sscanf ( cmd , "ssss" , event,sponsor,premiu,car ) )
      {
        SendClientMessage ( playerid , COLOR_RED , "{FF0000}Foloseste /event [ event ] [nume sponsor] [premiu] [cu masina da/nu]" ) ;
      }

Link to comment
Share on other sites

E codul postat de tine.

if(strcmp(cmd, "/tipevent", true) == 0)
  {

      new event[64],sponsor[64],premiu[64],car[64];
      if ( sscanf ( cmd , "ssss" , event,sponsor,premiu,car ) )
      {
        SendClientMessage ( playerid , COLOR_RED , "{FF0000}Foloseste /event [ event ] [nume sponsor] [premiu] [cu masina da/nu]" ) ;
      }
      else
      {
        new stri [ 255 ];
        format ( stri , 255 , "Eventul {FF0000}%s este organizat de sponsorul {FF0000}%s cu premiu de {FF0000%s . Cerinte vehicul: {FF0000}%s." ,event,sponsor,premiu,car ) ;
        SendClientMessageToAll(-1, stri);
      }

      return 1;
  }

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.