GiveWeapon
#1

Well can i make if player types the weapon id, the other person will also get the gun
pawn Код:
CMD:giveweapon(playerid, params[])
{
    if(PlayerData[playerid][AdminLevel] > 3)
    {
        new id,weap,ammo,str[128],name[MAX_PLAYER_NAME],WeapName[32];
        if(sscanf(params,"uii",id,weap,ammo)) return SendClientMessage(playerid,0xFF9900AA,"USAGE: /giveweapon [id] [weapon] [ammo]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That user is not connected!");
        GetPlayerName(playerid,name,sizeof(name));
        GetWeaponName(weap,WeapName,32);
        format(str,sizeof(str),"Administrator %s has gave you an %s (%d) with %d Ammo",name,WeapName,weap,ammo);
        SendClientMessage(id,0xFF9900AA,str);
        GivePlayerWeapon(id,weap,ammo);
     }
     else return 0;
     return 1;
}
Reply
#2

u change this to zcmd by ur self
pawn Код:
//--------------------------------[givegun]-------------------------------------
    if(strcmp(cmd, "/givegun", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 4) return DenyMessage(playerid, 4);
            new tmp2[256];
            new tmp3[256];
            tmp = strtok(cmdtext, idx);
            tmp2 = strtok(cmdtext, idx);
            tmp3 = strtok(cmdtext, idx);
            new otherplayer = ReturnUser(tmp);
            new gun = strval(tmp2);
            new ammo = strval(tmp3);
            gun = strval(tmp2);
            ammo = strval(tmp3);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givegun [playerid] [gun] [ammo]");
                return 1;
            }
            if(!strlen(tmp2))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givegun [playerid] [gun] [ammo]");
                return 1;
            }
            if(!strlen(tmp3))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givegun [playerid] [gun] [ammo]");
                return 1;
            }
            if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid PlayerID !");
            GivePlayerWeapon(otherplayer, gun, ammo);
        }
        return 1;
    }
Reply
#3

Quote:
Originally Posted by tanush
Посмотреть сообщение
Well can i make if player types the weapon id, the other person will also get the gun
pawn Код:
CMD:giveweapon(playerid, params[])
{
    if(PlayerData[playerid][AdminLevel] > 3)
    {
        new id,weap,ammo,str[128],name[MAX_PLAYER_NAME],WeapName[32];
        if(sscanf(params,"uii",id,weap,ammo)) return SendClientMessage(playerid,0xFF9900AA,"USAGE: /giveweapon [id] [weapon] [ammo]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That user is not connected!");
        GetPlayerName(playerid,name,sizeof(name));
        GetWeaponName(weap,WeapName,32);
        format(str,sizeof(str),"Administrator %s has gave you an %s (%d) with %d Ammo",name,WeapName,weap,ammo);
        SendClientMessage(id,0xFF9900AA,str);
        GivePlayerWeapon(id,weap,ammo);
     }
     else return 0;
     return 1;
}
When i put this in my script and compile it says:
pawn Код:
error 017: undefined symbol "cmd"
error 004: function "DenyMessage" is not implemented
error 017: undefined symbol "tmp"
error 017: undefined symbol "cmdtext"
error 017: undefined symbol "cmdtext"
error 017: undefined symbol "cmdtext"
error 017: undefined symbol "tmp"
error 017: undefined symbol "tmp"
I am Using the newest raven rp script. What do i have to do?
Reply
#4

It is because you are not using ZCMD
Reply
#5

How do i know what I am using?
Reply
#6

Quote:
Originally Posted by John_Conner
Посмотреть сообщение
How do i know what I am using?
Look at top of your script, if you don't have
pawn Код:
#include <zcmd>
That means you aren't using zcmd
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)