SA-MP Forums Archive
Please Read !! /handgun - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please Read !! /handgun (/showthread.php?tid=182477)



Please Read !! /handgun - salut693123 - 10.10.2010

Im searching a script so we can /handgun (playerid)

So after it give the gun to other guy
Please Reply and give me code or a Tutorial for it i hope you will helpme


Re: Please Read !! /handgun - gamer931215 - 10.10.2010

Read specially https://sampforum.blast.hk/showthread.php?tid=92 for tips

For the command you need these two:

https://sampwiki.blast.hk/wiki/GivePlayerWeapon

https://sampwiki.blast.hk/wiki/Weapons

Oh and sscanf for the (playerid) part, search for some tutorials for it
http://http://forum.sa-mp.com/search.php


Re: Please Read !! /handgun - salut693123 - 10.10.2010

Dude i dont want how to know giveplayerweapon that easy but like to make a command /handgun (gun) ( Ammo) :S


Re: Please Read !! /handgun - gamer931215 - 10.10.2010

Quote:
Originally Posted by salut693123
Посмотреть сообщение
Dude i dont want how to know giveplayerweapon that easy but like to make a command /handgun (gun) ( Ammo) :S
If you want to make a command, just make it yourself and learn to script


Re: Please Read !! /handgun - salut693123 - 10.10.2010

Dude how u think i can learn to fucking script?


Re: Please Read !! /handgun - DarrenReeder - 10.10.2010

what you need is sscanf... (i recommend learning ZCMD aswell)

https://sampwiki.blast.hk/wiki/Fast_Commands


Re: Please Read !! /handgun - Lorenc_ - 10.10.2010

I could help you there... Ill make the command in DCMD if you mind..


Re: Please Read !! /handgun - Lorenc_ - 10.10.2010

Sorry for a double post if i did Double post now but heres the code

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(givegun, 7, cmdtext);
    return 0;
}

dcmd_givegun(playerid, params[])
{
    //Maybe an if statement here.. I dont have the function although, you might add
    //the Distance between player...
    new pID1,
        Ammo = GetPlayerAmmo(playerid),
        Weapon = GetPlayerWeapon(playerid);

    if (sscanf(params, "u", pID1)) SendClientMessage(playerid, 0xFF0000AA, "/givegun PLAYERID");
    GivePlayerWeapon(pID1, Weapon, Ammo);
    ResetPlayerWeapons(playerid);
}
Note I still didnt test this...


Re: Please Read !! /handgun - salut693123 - 11.10.2010

C:\Documents and Settings\Philippe Veilleux.PHILIPPE\Bureau\test.pwn(92) : error 017: undefined symbol "dcmd"
C:\Documents and Settings\Philippe Veilleux.PHILIPPE\Bureau\test.pwn(243) : warning 203: symbol is never used: "dcmd_givegun"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: Please Read !! /handgun - [WSF]ThA_Devil - 11.10.2010

read this! We can't learn you nothing if you don't want to do nothing!
https://sampwiki.blast.hk/wiki/Fast_Commands