SA-MP Forums Archive
Weapons script - 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)
+--- Thread: Weapons script (/showthread.php?tid=378379)



Weapons script - Er@x3r - 17.09.2012

I was bored and i want to make a weapon script when i make this with 1 weapon it's worked but when i make with the all weapons:

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


here is the script:


#include <a_samp>
#if defined FILESCRIPT


public OnPlayerCommandText(playerid, cmdtext[])
{
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/givebrass", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,1,1);

if (strcmp("/givegolf", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,2,1);

if (strcmp("/givecopstick", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,3,1);

if (strcmp("/giveknife", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,4,1);

if (strcmp("/givebat", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,5,1);

if (strcmp("/giveshovel", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,6,1);

if (strcmp("/givepool", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,7,1);

if (strcmp("/givekatana", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,8,1);

if (strcmp("/givechainsaw", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,9,1);

if (strcmp("/givedildo1", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,10,1);

if (strcmp("/givedildo2", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,11,1);

if (strcmp("/givedildo3", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,12,1);

if (strcmp("/givedildo4", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,13,1);

if (strcmp("/giveflower", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,14,1);

if (strcmp("/givecane", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,15,1);

if (strcmp("/givegrenade", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,16,25);

if (strcmp("/givegastear", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,17,1000);

if (strcmp("/givemolotov", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,18,2;

if (strcmp("/givepistol", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,22,243);

if (strcmp("/givesilenced", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,23,200);

if (strcmp("/givedeagle", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,24,500);

if (strcmp("/giveshotgun", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,25,60);

if (strcmp("/givesawnoff", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,26,86);

if (strcmp("/givecombat", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,27,450);

if (strcmp("/giveuzi", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,28,600);

if (strcmp("/givemp5", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,29,349);

if (strcmp("/giveak47", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,30,250);

if (strcmp("/givem4", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,31,250);

if (strcmp("/givetec", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,32,750);

if (strcmp("/giverifle", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,33,140);

if (strcmp("/givesniper", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,34,200);

if (strcmp("/giverpg", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,35,5);

if (strcmp("/giverocket", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,36,7);

if (strcmp("/giveflame", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,37,1);

if (strcmp("/giveminigun", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,38,1000);

if (strcmp("/givebomb", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,39,1);

if (strcmp("/givedetonator", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,40,1);

if (strcmp("/givespray", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,41,300);

if (strcmp("/giveexting", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,42,413);

if (strcmp("/givecamera", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,43,1);

if (strcmp("/givenight", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,44,1);

if (strcmp("/giveparachute", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,46,1);

return 1;
}
return 0;

}
#endif


Re: Weapons script - SAMP_Luke - 17.09.2012

pawn Код:
#include <a_samp>
#if defined FILESCRIPT


   public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/givebrass", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,1,1);

       if (strcmp("/givegolf", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,2,1);

       if (strcmp("/givecopstick", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,3,1);

       if (strcmp("/giveknife", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,4,1);

       if (strcmp("/givebat", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,5,1);

       if (strcmp("/giveshovel", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,6,1);

       if (strcmp("/givepool", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,7,1);

       if (strcmp("/givekatana", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,8,1);

       if (strcmp("/givechainsaw", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,9,1);

       if (strcmp("/givedildo1", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,10,1);

       if (strcmp("/givedildo2", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,11,1);

       if (strcmp("/givedildo3", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,12,1);

       if (strcmp("/givedildo4", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,13,1);

       if (strcmp("/giveflower", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,14,1);

       if (strcmp("/givecane", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,15,1);

       if (strcmp("/givegrenade", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,16,25);

       if (strcmp("/givegastear", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,17,1000);

       if (strcmp("/givemolotov", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,18,28);

       if (strcmp("/givepistol", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,22,243);

       if (strcmp("/givesilenced", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,23,200);

       if (strcmp("/givedeagle", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,24,500);

       if (strcmp("/giveshotgun", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,25,60);

       if (strcmp("/givesawnoff", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,26,86);

       if (strcmp("/givecombat", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,27,450);

       if (strcmp("/giveuzi", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,28,600);

       if (strcmp("/givemp5", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,29,349);

       if (strcmp("/giveak47", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,30,250);

       if (strcmp("/givem4", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,31,250);

       if (strcmp("/givetec", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,32,750);

       if (strcmp("/giverifle", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,33,140);

       if (strcmp("/givesniper", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,34,200);

        if (strcmp("/giverpg", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,35,5);

        if (strcmp("/giverocket", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,36,7);

        if (strcmp("/giveflame", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,37,1);

        if (strcmp("/giveminigun", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,38,1000);

        if (strcmp("/givebomb", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,39,1);

        if (strcmp("/givedetonator", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,40,1);

        if (strcmp("/givespray", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,41,300);

        if (strcmp("/giveexting", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,42,413);

           if (strcmp("/givecamera", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,43,1);

           if (strcmp("/givenight", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,44,1);

           if (strcmp("/giveparachute", cmdtext, true, 10) == 0)
    {
       GivePlayerWeapon(playerid,46,1);

        return 1;
     }
    return 0;

}
#endif



Re: Weapons script - Er@x3r - 17.09.2012

what is the difference?