Script for me
#1

This is good ? Or bugget:

Код:
	if(strcmp(cmd, "/giveweapon", true) == 0)
	{
	if(PlayerInfo[playerid][Level] >= 2) {
	    new player1, tmp[256],weap,ammo;
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))	{
		SendClientMessage(playerid, red, "USAGE: /giveweapon [playerid] [weapon id]");
		return 1;	}

		player1 = strval(tmp);
		tmp = strtok(cmdtext, idx);
		weap = strval(tmp);
		if(!IsValidWeapon(weap)) return	SendClientMessage(playerid,red,"ERROR: Incorrect Weapon ID");
		tmp = strtok(cmdtext, idx);
		ammo = strval(tmp);
		GetPlayerName(player1, playername, sizeof(playername));		GetPlayerName(playerid, adminname, sizeof(adminname));
	 	if(IsPlayerConnected(player1))		{
			CMDMessageToAdmins(playerid,"GIVEWEAPON");
			GivePlayerWeapon(player1, weap, ammo);
			format(string, sizeof(string), "You have given %s weapon id: %d with %d rounds of ammo", playername,weap,ammo);	SendClientMessage(playerid,blue,string);
			format(string,256,"Administrator %s has given you weapon id: %d with %d rounds of ammo",adminname,weap,ammo); if(player1 != playerid)	{	SendClientMessage(player1,blue,string); }
   			return 1;
		} else {
 		SendClientMessage(playerid, red, "Player is not connected");
 		return 1;	}
	} else 	{
	SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");   }
 	return 1;	}
Reply


Messages In This Thread
Script for me - by [FoR]EveR - 17.03.2012, 09:17
Re: Script for me - by Reklez - 17.03.2012, 09:21
Re: Script for me - by [FoR]EveR - 17.03.2012, 09:24
Re: Script for me - by emokidx - 17.03.2012, 09:29
Re: Script for me - by [FoR]EveR - 17.03.2012, 09:34
Re: Script for me - by [FoR]EveR - 17.03.2012, 09:41
Re: Script for me - by Ronaldo_raul™ - 17.03.2012, 09:53

Forum Jump:


Users browsing this thread: 2 Guest(s)