SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 21/10/2009, 09:56 AM   #1
Nick_name
Big Clucker
 
Join Date: Jun 2008
Posts: 85
Reputation: 0
Default GetPlayerWeaponData

Does GetPlayerWeaponData works now? Or is it still bugged?
Nick_name is offline  
Old 21/10/2009, 10:11 AM   #2
pagie1111
Huge Clucker
 
Join Date: Dec 2008
Posts: 481
Reputation: 20
Default Re: GetPlayerWeaponData

pawn Code:
if(strcmp(cmd, "/weapons", true) == 0) // Checks a player's weapons
    {
        LogPlayerCommand(playerid,1,cmdtext);
        if(Account[playerid][Alevel] >= 1)
        {
          tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, ORANGE, "USAGE: /weapons [playerid]");
                return 1;
            }
            new targetid = ReturnUser(tmp);
            if (targetid != INVALID_PLAYER_ID)
            {
                new bullets[12];
                new weapons[12];
                new weapname[12][20];
                for(new i = 0; i < 12; i++)
                {
                  GetPlayerWeaponData(targetid, i+1, weapons[i], bullets[i]);
                  GetWeaponName(weapons[i], weapname[i], 20);
                }
                new giveplayername[MAX_PLAYER_NAME];
            GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
            format(string,sizeof(string),"    |-    %s's Weapons    -|",giveplayername);
            SendClientMessage(playerid,LIME,string);
                format(string, sizeof(string),"%s(0) - %s(%d) - %s(%d) - %s(%d) - %s(%d) - %s(%d)",weapname[0],weapname[1],bullets[1],weapname[2],bullets[2],weapname[3],bullets[3],weapname[4],bullets[4],weapname[5],bullets[5]);
                SendClientMessage(playerid,YELLOW,string);
                format(string,sizeof(string),"%s(%d) - %s(%d) - %s(%d) - %s(0) - %s(0) - %s(0)",weapname[6],bullets[6],weapname[7],bullets[7],weapname[8],bullets[8],weapname[9],weapname[10],weapname[11]);
                SendClientMessage(playerid,YELLOW,string);
            }
            else SendClientMessage(playerid, CORAL,"Invalid ID");
        }
        else return 0;
        return 1;
    }


Yes, this is an admin command in my server (taken from SeifAdmin)

EDIT: Server Version - 0.3a
__________________
BockScar
+1 rep
Hunger Games Coming soon!


________________________________________________
pagie1111 is offline  
Old 21/10/2009, 12:39 PM   #3
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Posts: 7,010
Reputation: 83
Default Re: GetPlayerWeaponData

Quote:
Originally Posted by Nick_name
Does GetPlayerWeaponData works now? Or is it still bugged?
Still? It always worked normally.
__________________
I'm still working on the LI-RP script and I'm not answering the PMs related to it. I don't need any beta-testers, so don't send me any PMs about it.

I also don't script for the money, so don't send me PMs about that, too.
Correlli is offline  
Old 21/10/2009, 12:42 PM   #4
MenaceX^
High-roller
 
Join Date: Aug 2008
Posts: 3,820
Reputation: 13
Default Re: GetPlayerWeaponData

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Nick_name
Does GetPlayerWeaponData works now? Or is it still bugged?
Still? It always worked normally.
No, it has/had some bugs..
MenaceX^ is offline  
Old 21/10/2009, 12:48 PM   #5
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Posts: 7,010
Reputation: 83
Default Re: GetPlayerWeaponData

Hm, i never had any problems with it (except the little ammo bug when it returned 65535 instead of 1).

Quote:
Originally Posted by MenaceX^
No, it has/had some bugs..
Which ones exactly?
__________________
I'm still working on the LI-RP script and I'm not answering the PMs related to it. I don't need any beta-testers, so don't send me any PMs about it.

I also don't script for the money, so don't send me PMs about that, too.
Correlli is offline  
Old 21/10/2009, 01:44 PM   #6
dice7
High-roller
 
Join Date: Apr 2009
Location: Slovenia
Posts: 2,241
Reputation: 11
Default Re: GetPlayerWeaponData

Quote:
Originally Posted by Don Correlli
Hm, i never had any problems with it (except the little ammo bug when it returned 65535 instead of 1).

Quote:
Originally Posted by MenaceX^
No, it has/had some bugs..
Which ones exactly?
They say that when you switch through weapons a lot and change your state, It'll return -1 for some ids/ammo.
65535 usually returns just for fists
dice7 is offline  
Old 21/10/2009, 01:48 PM   #7
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629
Posts: 13,272
Reputation: 1901
Default Re: GetPlayerWeaponData

Quote:
Originally Posted by dice7
They say
So have you actually TESTED anything? Or seen these bugs in either the new or old versions?
__________________
Y_Less is offline  
Old 21/10/2009, 01:50 PM   #8
dice7
High-roller
 
Join Date: Apr 2009
Location: Slovenia
Posts: 2,241
Reputation: 11
Default Re: GetPlayerWeaponData

Quote:
Originally Posted by Y_Leѕѕ
Quote:
Originally Posted by dice7
They say
So have you actually TESTED anything? Or seen these bugs in either the new or old versions?
Yes, in 0.2 the ammo sometimes gets unlimited and the fists return 65535. Other then that, I just saw other peoples posts
dice7 is offline  
Old 21/10/2009, 04:02 PM   #9
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629
Posts: 13,272
Reputation: 1901
Default Re: GetPlayerWeaponData

But did you test it on 0.3?
__________________
Y_Less is offline  
Old 14/11/2009, 02:17 PM   #10
mprofitt
Huge Clucker
 
Join Date: Jul 2008
Posts: 499
Reputation: 10
Default Re: GetPlayerWeaponData

Quote:
Originally Posted by Y_Leѕѕ
But did you test it on 0.3?
Still problems is 0.3, ammo returns wrong at times. Seem to happen if player vigorously scrolls through weapons.
mprofitt is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GetPlayerWeaponData Antonio [G-RP] Help Archive 2 29/05/2010 01:58 AM
GetPlayerWeaponData Not Work jame20702 Help Archive 6 02/05/2010 08:25 AM
GetPlayerWeaponData [SOLVED] Sascha Help Archive 3 28/04/2010 01:41 PM
GetPlayerWeaponData Schock Help Archive 1 15/02/2009 12:44 PM


All times are GMT. The time now is 03:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.