#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 |
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; }
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; } |
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; } |
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. |