help plz :D
#16

Quote:
Originally Posted by linuxthefish
Посмотреть сообщение
Paste this code onto the bottom of your script.
pawn Код:
CMD:giveweapon(playerid, params[])
{
    #pragma unused help
    if(IsPlayerAdmin(playerid))
     {
        new id,weap,ammo,str[128],Sender[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], Str[128], WeapName[32];
          if(sscanf(params,"uii",id,weap,ammo)) return SendClientMessage(playerid,-1,"USAGE: /giveweapon [id] [weapon] [ammo]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Player is not connected!");

        GetPlayerName(playerid,name,sizeof(name));
          GetPlayerName(id, Sender, sizeof(Sender));
        GetWeaponName(weap,WeapName,32);

        format(str,sizeof(str),"%s has given you a %s (%d) with %d Ammo.",name,WeapName,weap,ammo);
        SendClientMessage(id,-1,str);
          GivePlayerWeapon(id,weap,ammo);

          else return 0;
         return 1;
    }
    return 1;
}
ZCMD doesn't support the help parameter. This is a useful function which allows easy recognition of a command's description in y_commands.

PHP код:
CMD:giveweapon(playeridparams[])
{
    if(
IsPlayerAdmin(playerid))
     {
        new 
id,weap,ammo,str[128],Sender[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], Str[128], WeapName[32];
          if(
sscanf(params,"uii",id,weap,ammo)) return SendClientMessage(playerid,-1,"USAGE: /giveweapon [id] [weapon] [ammo]");
        if(!
IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Player is not connected!");
        
GetPlayerName(playerid,name,sizeof(name));
          
GetPlayerName(idSendersizeof(Sender));
        
GetWeaponName(weap,WeapName,32);
        
format(str,sizeof(str),"%s has given you a %s (%d) with %d Ammo.",name,WeapName,weap,ammo);
        
SendClientMessage(id,-1,str);
          
GivePlayerWeapon(id,weap,ammo);
          else return 
0;
         return 
1;
    }
    return 
1;

Reply


Messages In This Thread
help plz :D - by Stian - 18.08.2011, 18:53
Re: help plz :D - by ElieJabbour - 18.08.2011, 19:00
Re: help plz :D - by Kush - 18.08.2011, 19:15
Re: help plz :D - by ElieJabbour - 18.08.2011, 19:17
Re: help plz :D - by Kush - 18.08.2011, 19:22
Re: help plz :D - by ElieJabbour - 18.08.2011, 19:24
Re: help plz :D - by Stian - 18.08.2011, 22:40
Re: help plz :D - by Stian - 18.08.2011, 22:42
Re: help plz :D - by Kush - 18.08.2011, 22:47
Re: help plz :D - by ElieJabbour - 18.08.2011, 22:52
Re: help plz :D - by Stian - 18.08.2011, 22:54
Re: help plz :D - by ElieJabbour - 18.08.2011, 22:57
Re: help plz :D - by Stian - 18.08.2011, 23:15
Re: help plz :D - by linuxthefish - 18.08.2011, 23:21
Re: help plz :D - by Stian - 18.08.2011, 23:35
Re: help plz :D - by Kush - 19.08.2011, 00:03
Re: help plz :D - by Stian - 19.08.2011, 01:17

Forum Jump:


Users browsing this thread: 1 Guest(s)