11.09.2016, 15:55
Hello everyone. It's not common for me to ask for help on this forum but today i will do it because i am tired about this..
I made a object system, so the weappon when has 0 ammo should stay on the hand as attached object bla bla bla..
The problem is that i made that for check is a user is using ammo, put -1 ammo in OnPlayerWeaponShot, but it seems that the player shot but the ammo variable never lose value. I added to OnPlayerWeaponShot a SendClientMessage for check if it is being called but it's seems that it never send those messages.
Here you can see my OnPlayerWeaponShot:
And here you will see a video for understant better what is happening..
https://www.youtube.com/watch?v=5ROK...ature=*********
I made a object system, so the weappon when has 0 ammo should stay on the hand as attached object bla bla bla..
The problem is that i made that for check is a user is using ammo, put -1 ammo in OnPlayerWeaponShot, but it seems that the player shot but the ammo variable never lose value. I added to OnPlayerWeaponShot a SendClientMessage for check if it is being called but it's seems that it never send those messages.
Here you can see my OnPlayerWeaponShot:
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { if(EsArma(pInfo[playerid][ManoDer])) { pInfo[playerid][ManoDerCantidad]--;} //This reduce the ammo -1 new string[256]; format(string, sizeof(string), "Testeo: Disparas una bala, te quedan: %d. (Temporal)", pInfo[playerid][ManoDerCantidad]); SendClientMessage(playerid, Gris, string); //The message was never sent, so, wtf? return 1; } CMD:checkammo(playerid, params[]) { if(EsArma(pInfo[playerid][ManoDer])) { new string[256]; format(string, sizeof(string), "You have a weappon at the right hand; Ammo: %d", pInfo[playerid][ManoDerCantidad]); SendClientMessage(playerid, Gris, string); } return 1; }
https://www.youtube.com/watch?v=5ROK...ature=*********