Raised This Month: $51 Target: $400
 12% 

Change player's weapons with fakemeta


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 09-23-2017 , 16:28   Change player's weapons with fakemeta
Reply With Quote #1

Hey,

I've been trying to change player's weapon with get_pdata_int and set_pdata_int from fakemeta, but having some trouble.

Can anyone post an example on how to do this?

Regards,
$pirit
__________________
Spirit_12 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-23-2017 , 16:39   Re: Change player's weapons with fakemeta
Reply With Quote #2

I think you need show what you've tried.
__________________








CrazY. is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 09-23-2017 , 16:43   Re: Change player's weapons with fakemeta
Reply With Quote #3

Honestly, I have no clue on how to use these natives and grab player's private data. give_item from fun isn't working, so I want to try this route.
__________________
Spirit_12 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-23-2017 , 16:49   Re: Change player's weapons with fakemeta
Reply With Quote #4

You want just to give player a weapon or remove his actual weapon and give a new one?
__________________
HamletEagle is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 09-23-2017 , 18:47   Re: Change player's weapons with fakemeta
Reply With Quote #5

I would like to check, if a player has a weapon or not and based on that replace it, if needed.
__________________
Spirit_12 is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 09-23-2017 , 18:54   Re: Change player's weapons with fakemeta
Reply With Quote #6

PHP Code:
 if (get_user_weapon(id) == CSW_*)
give_item(id "weapon_id"
maybe that
killerZM is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 09-23-2017 , 19:14   Re: Change player's weapons with fakemeta
Reply With Quote #7

https://forums.alliedmods.net/showthread.php?t=187383
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 09-23-2017 , 21:12   Re: Change player's weapons with fakemeta
Reply With Quote #8

Quote:
Originally Posted by killerZM View Post
PHP Code:
 if (get_user_weapon(id) == CSW_*)
give_item(id "weapon_id"
maybe that
Give item method won't work in this case, that's why I'm directly trying to change client's private data.

Quote:
Originally Posted by raizo11 View Post
Not sure what I'm supposed to be looking for. Are you suggesting I should use pev natives as opposed to pdata?
__________________
Spirit_12 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 09-23-2017 , 21:40   Re: Change player's weapons with fakemeta
Reply With Quote #9

Quote:
Originally Posted by Spirit_12 View Post
give_item from fun isn't working,
Show us your code.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 09-24-2017 , 02:15   Re: Change player's weapons with fakemeta
Reply With Quote #10

There is no code with pdata in my plugin.

I'm saying I tried the giveitem native and it doesn't work. Since, you guys are asking for more info, let me say that it is to give items to the VIP. Not some random plugin VIP, but natural VIP that appears on as_ maps.

PHP Code:
public SwitchWeapons(id)
{
    if (
IsValidCTPlayer(id))
    {
        
strip_user_weapons(id);
        
give_item(id"weapon_usp");
        
give_item(id"weapon_knife");
        
give_item(id"weapon_tmp");
        
cs_set_user_bpammo(idCSW_USP35);
        
cs_set_user_bpammo(idCSW_TMP120);
    }
}

stock IsValidCTPlayer(id
{
    if (
is_user_connected(id) && (cs_get_user_team(id) == CS_TEAM_CT)) 
    {
        return 
id;
    }
    return 
0;

__________________

Last edited by Spirit_12; 09-24-2017 at 02:15.
Spirit_12 is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 22:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode