OnPlayerTakeDamage doesn't work -
NeXoR - 03.04.2016
As stated in previous threads I tried to return the cmd "dropgun" when a player takes damage (I didn't add bodypart for debugging)
Error shows up > Undefined symbol - Params
I know that it doesn't work because there isn't any params in the callback
So anyone knows how to fix it ? (Pretty new to experienced scripting)
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
new string[128];
format(string,sizeof(string),"-%.0f HP",amount);
SetPlayerChatBubble(playerid,string,0x660000AA,150.0,2500);
if(!IsPlayerInAnyVehicle(playerid) && IsPlayerLoggedIn(playerid))
{
return cmd_dropgun(playerid, params);
}
return 1;
}
Re: OnPlayerTakeDamage doesn't work -
Jefff - 03.04.2016
You can set any text or \1
pawn Код:
return cmd_dropgun(playerid, "blabla");
pawn Код:
return cmd_dropgun(playerid, "\1");
Re: OnPlayerTakeDamage doesn't work -
NeXoR - 03.04.2016
Quote:
Originally Posted by Jefff
You can set any text or \1
pawn Код:
return cmd_dropgun(playerid, "blabla");
pawn Код:
return cmd_dropgun(playerid, "\1");
|
Can I simply return without params ?
I mean (playerid);
Re: OnPlayerTakeDamage doesn't work -
Jefff - 03.04.2016
Should work, try to compile
Re: OnPlayerTakeDamage doesn't work -
NeXoR - 03.04.2016
Quote:
Originally Posted by Jefff
Should work, try to compile
|
Show's up a warning
I can try to send "" = (playerid, "");
Re: OnPlayerTakeDamage doesn't work -
AndySedeyn - 03.04.2016
Declare the command without the 'params' parameter:
PHP код:
CMD:dropgun(playerid) {
return true;
}
And then use it like so:
PHP код:
return cmd_dropgun(playerid);
Re: OnPlayerTakeDamage doesn't work -
NeXoR - 03.04.2016
Quote:
Originally Posted by AndySedeyn
Declare the command without the 'params' parameter:
PHP код:
CMD:dropgun(playerid) {
return true;
}
And then use it like so:
PHP код:
return cmd_dropgun(playerid);
|
works
BTW, the callback shows an error on my script
PHP код:
D:\samp037_svr_R2-1-1_win32\gamemodes\UGRP.pwn(7621) : error 025: function heading differs from prototype
All I did was adding "bodypart" to the end
Current:
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
Previous:
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
Re: OnPlayerTakeDamage doesn't work -
AndySedeyn - 03.04.2016
Is your a_samp include up to date?
Re: OnPlayerTakeDamage doesn't work -
NeXoR - 03.04.2016
Quote:
Originally Posted by AndySedeyn
Is your a_samp include up to date?
|
Should be, I redownloaded it today to update PoolSize, I'll update it once again to validate
EDIT - Yes its updated
Re: OnPlayerTakeDamage doesn't work -
AndySedeyn - 03.04.2016
Quote:
Originally Posted by NeXoR
Should be, I redownloaded it today to update PoolSize, I'll update it once again to validate
|
Are you using an old version of YSI? If so, check this out:
https://sampforum.blast.hk/showthread.php?tid=488198