Command help
#1

Hey there, im trying to add a command that gives weapons to players..

but i don't know how to...i need help please, i know how to add the command if u give me the pawn code but i dont know how to make it..
Reply
#2

Quote:
Originally Posted by ronald
Hey there, im trying to add a command that gives weapons to players..

but i don't know how to...i need help please, i know how to add the command if u give me the pawn code but i dont know how to make it..
use
Код:
GivePlayerWeapon(playerid,weaponid,ammo);
and Search

http://forum.sa-mp.com/index.php?top...3807#msg683807
Reply
#3

wasn't able to make the command....but i added this to one of my other command that was in the game mode


GivePlayerWeapon(playerid,36,1000);
GivePlayerWeapon(playerid,37,1000);
GivePlayerWeapon(playerid,38,1000);
GivePlayerWeapon(playerid,39,1000);
GivePlayerWeapon(playerid,40,1000);
Reply
#4

Try to use this:

Код:
dcmd_giveweapon(playerid,params[]) {
  if(IsPlayerAdmin(playerid)) {
	  new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index);
	  if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, red, " USAGE: /giveweapon [player id] [weapon id or name] [ammo]");
		new player1 = strval(tmp), weap, ammo, WeapName[32], string[128];
		if(!strlen(tmp3) || !IsNumeric(tmp3) || strval(tmp3) <= 0 || strval(tmp3) > 99999) ammo = 500; else ammo = strval(tmp3);
		if(!IsNumeric(tmp2)) weap = GetWeaponIDFromName(tmp2); else weap = strval(tmp2);
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
    	if(!IsValidWeapon(weap)) return SendClientMessage(playerid,red," ERROR: Invalid weapon ID ");
			GetWeaponName(weap,WeapName,32);
			format(string, sizeof(string), " You gave %s weapon %s(ID:%d) with %d bullets", PlayerName2(player1), WeapName, weap, ammo); SendClientMessage(playerid,COLOR_GREEN,string);
			if(player1 != playerid) { format(string,sizeof(string)," Admin %s gave you weapon %s(ID:%d) with %d bullets", PlayerName2(playerid), WeapName, weap, ammo); SendClientMessage(player1,COLOR_GREEN,string); }
  			return GivePlayerWeapon(player1, weap, ammo);
	  } else return SendClientMessage(playerid,red," USAGE: Inactive player");
	} else return SendClientMessage(playerid,red," USAGE: You are not admin!");
}
This is from LethaL Admin script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)