Questions
#1

Well, I'm planning to create a command like "givegun" (Not admin command, but a player command).

Eh, since i haven't started, i will give some questions(Most of them will probably sound dumb, lol.)

#1 - Could "GivePlayerWeapon(id, GetPlayerWeapon(playerid), amount)" work?
The command should make it so the player gives the target the weapon he is holding.

#2 - How can you detect if the player doesn't have so much ammunition? GetPlayerWeaponData stuff, or..?

Well.. that's about it, hope that you could answer/explain it to me :]
Reply
#2

#1 .. ofc, to detect other player use

tmp = strtok(cmdtext, idx);
otherplayer = ReturnUser(tmp);

#2 .. yup .. https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
Reply
#3

Quote:
Originally Posted by Stereotype
Посмотреть сообщение
#1 .. ofc, to detect other player use otherplayer = ReturnUser(tmp);

#2 .. yup .. https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
Alright, uh, could you give me an example of the #2 please?;d
Reply
#4

here is my cmd that check player weapons

pawn Код:
CMD:getweapons(playerid, params[])
{
    new message[128], Player, weapon, ammo;
    if(pInfo[playerid][AdminLevel] < 2) return admMsg(playerid);
    if(sscanf(params, "u", Player)) return SCM(playerid, 0xC4C4C4FF, "Usage: /getweapons <playerid>");
    for(new i=0;i<13;i++)
    {
        GetPlayerWeaponData(Player, i, weapon, ammo);
        if(weapon != 0)
        {
            format(message, sizeof(message), "Player %s's weapons: Slot(%d): Weapon ID(%d) Ammo(%d)", GetName(Player),i, weapon, ammo);
            SendClientMessage(playerid, -1, message);
            return 1;
        }
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Stereotype
Посмотреть сообщение
here is my cmd that check player weapons

pawn Код:
CMD:getweapons(playerid, params[])
{
    new message[128], Player, weapon, ammo;
    if(pInfo[playerid][AdminLevel] < 2) return admMsg(playerid);
    if(sscanf(params, "u", Player)) return SCM(playerid, 0xC4C4C4FF, "Usage: /getweapons <playerid>");
    for(new i=0;i<13;i++)
    {
        GetPlayerWeaponData(Player, i, weapon, ammo);
        if(weapon != 0)
        {
            format(message, sizeof(message), "Player %s's weapons: Slot(%d): Weapon ID(%d) Ammo(%d)", GetName(Player),i, weapon, ammo);
            SendClientMessage(playerid, -1, message);
            return 1;
        }
    }
    return 1;
}
Hm, alright, thanks for the quick answers!
+rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)