Cerere plugin lotto 6/49

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
Vyseer
Membru, skill 0
Membru, skill 0
Posts: 62
Joined: 14 Jul 2011, 22:30
Detinator Steam: Da
CS Status: Băntui pe forumul eXtreamCS.com...!
Has thanked: 56 times
Been thanked: 1 time
Contact:

20 Dec 2013, 13:37

As dori si eu un plugin care sa îţi regenereze 6 numere aleatorie din 49
sa scrii /lotto si sa îţi apara in chat cele 6 numere
si fiecare tastare a comenzi sa coste 5000$
Mulţumesc...
RoyalServer 2
Vyseer
Membru, skill 0
Membru, skill 0
Posts: 62
Joined: 14 Jul 2011, 22:30
Detinator Steam: Da
CS Status: Băntui pe forumul eXtreamCS.com...!
Has thanked: 56 times
Been thanked: 1 time
Contact:

24 Dec 2013, 17:50

Up up up
teNNeke.
Membru, skill +1
Membru, skill +1
Posts: 318
Joined: 01 Sep 2013, 17:59
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 36 times
Been thanked: 9 times
Contact:

24 Dec 2013, 19:47

Il am eu, doar contracost.
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

24 Dec 2013, 20:10

teNNeke. wrote:Il am eu, doar contracost.
Ce greu era :-@

Code: Select all

#include < amxmodx >
#include < cstrike >

#define PLUGIN_NAME "Lotto"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "cruyff"

new g_Number[ 8 ];

public plugin_init( )
{
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_clcmd( "say /lotto", "Func_Lotto" );
}

public Func_Lotto( id )
{
	if( cs_get_user_money( id ) < 5000 )
	{
		client_print( 0, print_chat, "Nu ai destui bani." );
	}
	
	else
	{
		client_print( 0, print_chat, "Cele 6 numere extrase la lotto:^n" );

		for( new i = 1; i < 6; i++ )
		{
			g_Number[ i ] = random_num( 0, 49 );
			
			client_print( 0, print_chat, "%i: %i", i, g_Number[ i ] );
			
			cs_set_user_money( id, cs_get_user_money( id ) - 5000 );
		}
	}
}	
Retras
teNNeke.
Membru, skill +1
Membru, skill +1
Posts: 318
Joined: 01 Sep 2013, 17:59
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 36 times
Been thanked: 9 times
Contact:

24 Dec 2013, 21:43

cruyff wrote:
teNNeke. wrote:Il am eu, doar contracost.
Ce greu era :-@

Code: Select all

#include < amxmodx >
#include < cstrike >

#define PLUGIN_NAME "Lotto"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "cruyff"

new g_Number[ 8 ];

public plugin_init( )
{
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_clcmd( "say /lotto", "Func_Lotto" );
}

public Func_Lotto( id )
{
	if( cs_get_user_money( id ) < 5000 )
	{
		client_print( 0, print_chat, "Nu ai destui bani." );
	}
	
	else
	{
		client_print( 0, print_chat, "Cele 6 numere extrase la lotto:^n" );

		for( new i = 1; i < 6; i++ )
		{
			g_Number[ i ] = random_num( 0, 49 );
			
			client_print( 0, print_chat, "%i: %i", i, g_Number[ i ] );
			
			cs_set_user_money( id, cs_get_user_money( id ) - 5000 );
		}
	}
}	
Nu e complet, ceea ce am eu privat are 8kb.
Last edited by munir on 24 Dec 2013, 21:45, edited 1 time in total.
Reason: Ce a cerut el, ce-i dai tu.
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

24 Dec 2013, 22:41

cruyff wrote:
teNNeke. wrote:Il am eu, doar contracost.
Ce greu era :-@

Code: Select all

#include < amxmodx >
#include < cstrike >

#define PLUGIN_NAME "Lotto"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "cruyff"

new g_Number[ 8 ];

public plugin_init( )
{
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_clcmd( "say /lotto", "Func_Lotto" );
}

public Func_Lotto( id )
{
	if( cs_get_user_money( id ) < 5000 )
	{
		client_print( 0, print_chat, "Nu ai destui bani." );
	}
	
	else
	{
		client_print( 0, print_chat, "Cele 6 numere extrase la lotto:^n" );

		for( new i = 1; i < 6; i++ )
		{
			g_Number[ i ] = random_num( 0, 49 );
			
			client_print( 0, print_chat, "%i: %i", i, g_Number[ i ] );
			
			cs_set_user_money( id, cs_get_user_money( id ) - 5000 );
		}
	}
}	
Gresit total.
93.114.82.17:27015 - Monster Invasion CO-OP Mod
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

24 Dec 2013, 22:53

cyby wrote:
cruyff wrote:
teNNeke. wrote:Il am eu, doar contracost.
Ce greu era :-@

Code: Select all

#include < amxmodx >
#include < cstrike >

#define PLUGIN_NAME "Lotto"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "cruyff"

new g_Number[ 8 ];

public plugin_init( )
{
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_clcmd( "say /lotto", "Func_Lotto" );
}

public Func_Lotto( id )
{
	if( cs_get_user_money( id ) < 5000 )
	{
		client_print( 0, print_chat, "Nu ai destui bani." );
	}
	
	else
	{
		client_print( 0, print_chat, "Cele 6 numere extrase la lotto:^n" );

		for( new i = 1; i < 6; i++ )
		{
			g_Number[ i ] = random_num( 0, 49 );
			
			client_print( 0, print_chat, "%i: %i", i, g_Number[ i ] );
			
			cs_set_user_money( id, cs_get_user_money( id ) - 5000 );
		}
	}
}	
Gresit total.
Eu vad ca functioneaza

Code: Select all

1: 3
2: 33
3: 45
4: 4
   VAC secure mode disabled.
O singura greseala, rezolvata
| Afiseaza codul
#include < amxmodx >
#include < cstrike >

#define PLUGIN_NAME "Lotto"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "cruyff"

new g_Number[ 8 ];

public plugin_init( )
{
   register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
   
   register_clcmd( "say /lotto", "Func_Lotto" );
}

public Func_Lotto( id )
{
   if( cs_get_user_money( id ) < 5000 )
   {
      client_print( 0, print_chat, "Nu ai destui bani." );
   }
   
   else
   {
      client_print( 0, print_chat, "Cele 6 numere extrase la lotto:^n" );

      for( new i = 1; i < 7; i++ )
      {
         g_Number[ i ] = random_num( 0, 49 );
         
         client_print( 0, print_chat, "%i: %i", i, g_Number[ i ] );
         
         cs_set_user_money( id, cs_get_user_money( id ) - 5000 );
      }
   }
}
Btw, o sa-ti afiseze numerele in consola, pentru ca in chat ti le afiseaza rapid, in interval de 0,1 sec, si o sa le vezi pe ultimele 4.
Retras
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

24 Dec 2013, 23:55

Iar gresit.
Iti ia de prea multe ori banii in primul rand ca ai introdus luarea banilor in for si numerele la loto nu sunt repetative, a ales unu nu mai poate fi acelasi.
93.114.82.17:27015 - Monster Invasion CO-OP Mod
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

25 Dec 2013, 10:00

| Afiseaza codul
#include < amxmodx >
#include < cstrike >

#define PLUGIN_NAME "Lotto"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "cruyff"

new g_Number[ 8 ];

public plugin_init( )
{
   register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
   
   register_clcmd( "say /lotto", "Func_Lotto" );
}

public Func_Lotto( id )
{
	if( cs_get_user_money( id ) < 5000 )
	{
		client_print( 0, print_chat, "Nu ai destui bani." );
	}
   
	else
	{
		client_print( 0, print_chat, "Cele 6 numere extrase la lotto:" );

		for( new i = 1; i < 7; i++ )
		{
			g_Number[ i ] = random_num( 0, 49 );
         
			client_print( 0, print_chat, "%i: %i", i, g_Number[ i ] );
		}
	  
		cs_set_user_money( id, cs_get_user_money( id ) - 5000 );
	}
}
Greseala mea. Aseara cand l-am facut eram prea obosit ca sa-mi dau seama de greseli. (venisem de la munca.)
Retras
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests