How create command for random stuffs
#1

Hello guys!
I have question how should i create cmd command who give you random stuff like (Skins,gun,hp and others) when i type /test i got one that stuff. And i can do it only per 200sec.
Reply
#2

Wrong section , we are helping here, ot give any tutorials or script for you
Reply
#3

Hey Henkas!
First Download ZCMD it will let Creating Command Easy Download-ZCMD
After Copy The zcmd.inc to Your Pawno>includes There paste it,

Now Go open Pawno File then open the Pawno Application, Open new and Lets Start:

Steps:

Quote:
#include <a_samp>
#include <zcmd>


CMD:healme(playerid,params[])
{
SetPlayerHealth(100);
SendClientMessage(playerid,0x000000FF, "You've Been Healed by Health System");
GameTextForPlayer(playerid,"~B~HEALED!",3000,5);
return 1;
}

CMD:gun(playerid,params[])
{
GivePlayerWeapon(playerid,34,200);
return 1;
}
//Write The Weapon id What you want and Write The Ammount How much You Want it

And You Can More Like this... Hope that i helped you
Reply
#4

X445 I think you mis-read what he wanted.

He wants to be able to type a command /test, and it will randomly give him different stuff.

here is an example.

Код:
CMD:test( playerid, params[] )
{
	new rand = Random( 11 );

	switch( rand )
	{
		case 0 .. 2: // if rand is between 0 and 2 then run the code here
		{
			// Give Money Here
		}

		case 3 .. 5: // if rand is between 3 and 5 then run the code here
		{
			// Give Weapons Here
		}

		case 6 .. 8: // if rand is between 6 and 8 then run the code here
		{
			// Give Health or Armour
		}

		case 9 .. 11: // if rand is between 9 and 11 then run the code here
		{
			// Change Skin
		}

	}

	return 1;
}
I hope this is what you wanted, feel free to reply if you are still having issues.
Reply
#5

Quote:
Originally Posted by azzerking
Посмотреть сообщение
X445 I think you mis-read what he wanted.

He wants to be able to type a command /test, and it will randomly give him different stuff.

here is an example.

Код:
CMD:test( playerid, params[] )
{
	new rand = Random( 11 );

	switch( rand )
	{
		case 0 .. 2: // if rand is between 0 and 2 then run the code here
		{
			// Give Money Here
		}

		case 3 .. 5: // if rand is between 3 and 5 then run the code here
		{
			// Give Weapons Here
		}

		case 6 .. 8: // if rand is between 6 and 8 then run the code here
		{
			// Give Health or Armour
		}

		case 9 .. 11: // if rand is between 9 and 11 then run the code here
		{
			// Change Skin
		}

	}

	return 1;
}
I hope this is what you wanted, feel free to reply if you are still having issues.
Yup bro thats what i need. Thanks (y)
Reply
#6

Amm i got error

error 017: undefined symbol "Random"
Reply
#7

It is random (lower case).

By the way random(11) will give a random number between 0-10 so in the last case it won't be 9 to 11.
Reply
#8

Oh, god your so right.

I realized that not long after I replied, but I was dealing with another thread so I did not reply.

your right though.
Reply
#9

Quote:
Originally Posted by azzerking
Посмотреть сообщение
X445 I think you mis-read what he wanted.

He wants to be able to type a command /test, and it will randomly give him different stuff.

here is an example.

Код:
CMD:test( playerid, params[] )
{
	new rand = Random( 11 );

	switch( rand )
	{
		case 0 .. 2: // if rand is between 0 and 2 then run the code here
		{
			// Give Money Here
		}

		case 3 .. 5: // if rand is between 3 and 5 then run the code here
		{
			// Give Weapons Here
		}

		case 6 .. 8: // if rand is between 6 and 8 then run the code here
		{
			// Give Health or Armour
		}

		case 9 .. 11: // if rand is between 9 and 11 then run the code here
		{
			// Change Skin
		}

	}

	return 1;
}
I hope this is what you wanted, feel free to reply if you are still having issues.
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
It is random (lower case).

By the way random(11) will give a random number between 0-10 so in the last case it won't be 9 to 11.
Omg i haven't saw this D thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)