Jump to content
  • 0

CUm pun reguli


Guest Ken

Question

5 answers to this question

Recommended Posts

La OnPlayerConnect ,dupa { pui

SendClientMessage(playerID, CULOAREA "regula 1");

SendClientMessage(playerID, CULOAREA "regula 2");

SendClientMessage(playerID, CULOAREA "regula 3");

SendClientMessage(playerID, CULOAREA "regula 4");

....

si tot asa.

logo.png

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

Link to comment
Share on other sites

public OnPlayerCommandText( playerid, cmdtext[ ] )

{

   new

        cmd[ 30 ],

        idx;

   cmd = strtok(cmdtext, idx);

   if( strcmp( cmd, "/rules", true ) == 0 || strcmp( cmd, "/reguli", true )== 0 )

   {

SendClientMessage( playerid, CULOAREA, "text" );

SendClientMessage( playerid, CULOAREA, "text2" );

SendClientMessage( playerid, CULOAREA, "text3" );

SendClientMessage( playerid, CULOAREA, "text4" );

SendClientMessage( playerid, CULOAREA, "text5" );

return true;

   }

   return false;

}

Link to comment
Share on other sites

public OnPlayerCommandText( playerid, cmdtext[ ] )

{

  //CORECTAT

   if( strcmp( cmdtext, "/rules", true ) == 0 || strcmp( cmdtext, "/reguli", true )== 0 )

   {

SendClientMessage( playerid, CULOAREA, "text" );

SendClientMessage( playerid, CULOAREA, "text2" );

SendClientMessage( playerid, CULOAREA, "text3" );

SendClientMessage( playerid, CULOAREA, "text4" );

SendClientMessage( playerid, CULOAREA, "text5" );

return true;

   }

   return false;

}

Lazlow, dc pui strtok atunci cand nu-l folosesti ? Daca, comanda avea parametrii puneai strtok dar asa, nu e nevoie.

Vyo: ai uitat ) de la capat

deci Ken tata... ia de aici: 1. comanda de mai sus si

2.

Reguliile sunt doar niste mesaje (cand se conecteaza), aceste mesaje poti sa le pui unde vrei tu.

Uite un exemplu cu OnPlayerConnect

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, CULOARE, "Bine ai venit!");
    SendClientMessage(playerid, CULOARE, "Te rog sa respecti reguliile urmatoare:");
    SendClientMessage(playerid, CULOARE, "Nu injura.");
    SendClientMessage(playerid, CULOARE, "Nu face spam pe chat.");
    return 1;
}

Asta e doar un exemplu. :P

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

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.