Need Help To Get Player Weapon ID
#1

Hi
how to get player weapon id?

like:
Код:
GetPlayerWeaponID(playerid);
or get all weapon id like:
Код:
if(GetPlayerWeapon(playerid) == i)
Reply
#2

GetPlayerWeapon return the weaponid which the player is currently holding.
But no, you can't do this for get all player's weapon. You have to use GetPlayerWeaponData (took from the wiki):
PHP код:
// Common use: get all weapons and store info in an array containing 13 slots
// The first value is the weapon ID, and second is the ammo
 
new weapons[13][2];
 
for (new 
0<= 12i++)
{
    
GetPlayerWeaponData(playeridiweapons[i][0], weapons[i][1]);

Reply
#3

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
GetPlayerWeapon return the weaponid which the player is currently holding.
But no, you can't do this for get all player's weapon. You have to use GetPlayerWeaponData (took from the wiki):
PHP код:
// Common use: get all weapons and store info in an array containing 13 slots
// The first value is the weapon ID, and second is the ammo
 
new weapons[13][2];
 
for (new 
0<= 12i++)
{
    
GetPlayerWeaponData(playeridiweapons[i][0], weapons[i][1]);

bro i wanna get all weapons

if killer kill player then send msg to player that he killed by weapon %s
Reply
#4

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
     if(
killerid != INVALID_PLAYER_IDSendDeathMessage(killeridplayeridreason);
     return 
1;

Reply
#5

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
     if(
killerid != INVALID_PLAYER_IDSendDeathMessage(killeridplayeridreason);
     return 
1;

According to wiki, it's no problem if the killerid is invalid when sending a death message.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)