help plz :D
#1

anyone have a script for /giveweapond and Death List
Reply
#2

Wrong section..

And try this

pawn Код:
if(strcmp(cmd, "/giveweapon", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givegun [playerid/PartOfName] [weaponid(eg. 46 = Parachute)] [ammo]");
                return 1;
            }
            new playa;
            new gun;
            new ammo;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            gun = strval(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /givegun [playerid/PartOfName] [weaponid] [ammo]");
                SendClientMessage(playerid, COLOR_GRAD4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
                SendClientMessage(playerid, COLOR_GRAD3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            ammo = strval(tmp);
            if(ammo <1||ammo > 9999)
            { SendClientMessage(playerid, COLOR_GRAD1, "   dont go below 1 or above 9999 bullets!"); return 1; }
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        GivePlayerWeaponEx(playa, gun, ammo);
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        if(PlayerInfo[playerid][pAdmin] == 11) { sendername = "Hidden Admin"; }
                        format(string, 256, "AdmWarning: %s has given %s gun id %d.", sendername,giveplayer,gun);
                        ABroadCast(COLOR_YELLOW,string,1);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }
Reply
#3

Quote:
Originally Posted by ElieJabbour
Посмотреть сообщение
Wrong section..

And try this

pawn Код:
if(strcmp(cmd, "/giveweapon", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givegun [playerid/PartOfName] [weaponid(eg. 46 = Parachute)] [ammo]");
                return 1;
            }
            new playa;
            new gun;
            new ammo;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            gun = strval(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /givegun [playerid/PartOfName] [weaponid] [ammo]");
                SendClientMessage(playerid, COLOR_GRAD4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
                SendClientMessage(playerid, COLOR_GRAD3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            ammo = strval(tmp);
            if(ammo <1||ammo > 9999)
            { SendClientMessage(playerid, COLOR_GRAD1, "   dont go below 1 or above 9999 bullets!"); return 1; }
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        GivePlayerWeaponEx(playa, gun, ammo);
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        if(PlayerInfo[playerid][pAdmin] == 11) { sendername = "Hidden Admin"; }
                        format(string, 256, "AdmWarning: %s has given %s gun id %d.", sendername,giveplayer,gun);
                        ABroadCast(COLOR_YELLOW,string,1);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }
Why do you keep stripping these useless codes from the godfather!

PHP код:
YCMD:giveweapon(playeridparams[], help)
{
    
#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(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;

Done in YCMD.
Reply
#4

Quote:
Originally Posted by Kush
Посмотреть сообщение
Why do you keep stripping these useless codes from the godfather!

PHP код:
YCMD:giveweapon(playeridparams[], help)
{
    
#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(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;

Done in YCMD.
Do you wanna see where the hell am gettin it from god damn ?
Reply
#5

Quote:
Originally Posted by ElieJabbour
Посмотреть сообщение
Do you wanna see where the hell am gettin it from god damn ?
Let me put it to you straight.

Your acting like a 12 year old. You try to help people, but realistically both I and other members of the forum can see that isn't your own code. Firstly, who even say's that he has those variables defined within his script. Secondly who's still using strcmp to call commands? Anyone using strcmp is most likely using Godfather or an older script. You attempt to give a solution to the simplest problems and yet fail. I'm not starting a war with you, nor I am I flaming at you. I am pointing out your faults, because you seem to be extremely conceited if you think you wrote that code.

Have a nice day.
Reply
#6

Quote:
Originally Posted by Kush
Посмотреть сообщение
Let me put it to you straight.

Your acting like a 12 year old. You try to help people, but realistically both I and other members of the forum can see that isn't your own code. Firstly, who even say's that he has those variables defined within his script. Secondly who's still using strcmp to call commands? Anyone using strcmp is most likely using Godfather or an older script. You attempt to give a solution to the simplest problems and yet fail. I'm not starting a war with you, nor I am I flaming at you. I am pointing out your faults, because you seem to be extremely conceited if you think you wrote that code.

Have a nice day.
Did i fucking tell ya its mine ?, No
Didn't it Help ? It Did.

I Believe the Thread is called : Help Plz, Isn't it ?

And it seems quite weird that the scripts am giving are working to some people, And when i release a GM on samp, you'll see where am gettin the codes from.. Now if you please stop STALKING Me.

Plus you're the one who's raging whenever i try to help someone, lol..

Srsly you need a life.
Reply
#7

Tnx
Reply
#8

Btw where in Pawno shold i past it **Newbie**
Reply
#9

Quote:
Originally Posted by Stian
Посмотреть сообщение
Btw where in Pawno shold i past it **Newbie**
What gamemode are you using?
Reply
#10

Quote:
Originally Posted by Kush
Посмотреть сообщение
What gamemode are you using?
Shouldn't he post it under OnPlayerCommandText ?O.o
Reply
#11

PPC_Trucking didn't fine the page for it
Reply
#12

Quote:
Originally Posted by Stian
Посмотреть сообщение
PPC_Trucking didn't fine the page for it
What do you mean ?
Reply
#13

Quote:
Originally Posted by Kush
Посмотреть сообщение
What gamemode are you using?
i use PCC_trucking
Reply
#14

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;
}
Reply
#15

C:\Users\stian\Desktop\gta sa trucking server\pawno\include\PPC_Dialogs.inc(832) : error 017: undefined symbol "VClassRCVehicle"
C:\Users\stian\Desktop\gta sa trucking server\pawno\include\PPC_Dialogs.inc(1406) : error 017: undefined symbol "VClassRCVehicle"
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1496) : error 017: undefined symbol "help"
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1500) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1501) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1504) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1505) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1509) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1511) : error 029: invalid expression, assumed zero
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1511) : warning 215: expression has no effect
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1511) : error 001: expected token: ";", but found "return"
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1512) : warning 225: unreachable code
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1512) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1499) : warning 204: symbol is assigned a value that is never used: "Str"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Reply
#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
#17

Quote:
Originally Posted by Kush
Посмотреть сообщение
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;

C:\Users\stian\Desktop\gta sa trucking server\pawno\include\PPC_Dialogs.inc(832) : error 017: undefined symbol "VClassRCVehicle"
C:\Users\stian\Desktop\gta sa trucking server\pawno\include\PPC_Dialogs.inc(1406) : error 017: undefined symbol "VClassRCVehicle"
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1499) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1500) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1503) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1504) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(150 : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1510) : error 029: invalid expression, assumed zero
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1510) : warning 215: expression has no effect
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1510) : error 001: expected token: ";", but found "return"
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1511) : warning 225: unreachable code
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1511) : warning 217: loose indentation
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(149 : warning 204: symbol is assigned a value that is never used: "Str"
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1498 -- 1513) : warning 209: function "cmd_giveweapon" should return a value
C:\Users\stian\Desktop\gta sa trucking server\gamemodes\PPC_Trucking.pwn(1498 -- 1513) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)