[Include] OnPlayerWeaponStateChange
#1

Hi,I'm gonna to show you my first callback!

It's called everytime when player changes his weapon state...


PHP код:
OnPlayerWeaponStateChange(playeridoldstatenewstate
You can find all weapon states at this link

Download(v 0.1):

Mediafire

Pastebin


Update (v 0.2)!

I create a small update.Changes:


-Minor bugs fixed
-Added weaponid and weaponname parameters


PHP код:
OnPlayerWeaponStateChange(playeridweaponidoldstatenewstateweaponname[]) 
Download(v 0.2):

Mediafire

Pastebin
Reply
#2

Very nice for ur first callback!
Reply
#3

Quote:
Originally Posted by XtremeR
Посмотреть сообщение
Very nice for ur first callback!
Thanks you
Reply
#4

Rep+6 for the work. Good one mate. Keep it up!
Reply
#5

This will mess up certain callbacks that don't return 1.
Reply
#6

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
This will mess up certain callbacks that don't return 1.
Can you fix the code and upload it again for us Sv?
Reply
#7

Simple and nice.
Btw, what do you mean by this?
pawn Код:
new ab[256];
//Then using it as ab[playerid]. Shouldn't it be:
new ab[MAX_PLAYERS];
And Ballu Miaa, here's that code
pawn Код:
public OnPlayerUpdate(playerid)
{
new ab[256];
ab[playerid] = GetPlayerWeaponState(playerid);
new pWeaponStatePlovixxx = strval(ab[playerid]);
if(pWeaponStatePlovixxx != pWeaponStatePlovixx[playerid])
CallLocalFunction("OnPlayerWeaponStateChange", "idd", playerid, pWeaponStatePlovixx[playerid], pWeaponStatePlovixxx);
pWeaponStatePlovixx[playerid] = pWeaponStatePlovixxx;
CallLocalFunction("ExampleOPU", "i", playerid);
return 1;
}
Reply
#8

pawn Код:
new ab[256];
ab[playerid] = GetPlayerWeaponState(playerid);
new pWeaponStatePlovixxx = strval(ab[playerid]);
LoL?

pawn Код:
new pWeaponStatePlovixxx = GetPlayerWeaponState(playerid);
This is enough....
Reply
#9

Thank you all for comments and reputations!I have update callback(v0.2).Changes:
-Minor bugs fixed
-Added weaponid and weaponname parameters
Reply
#10

Never think of this before...
Nice job..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)