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

stock retrun float tag mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 01-25-2015 , 01:39   stock retrun float tag mismatch
Reply With Quote #1

It works but it shows error when compile.How to fix this?

PHP Code:
stock GetKillDeath(killdeath)
{
    new 
Float:kd = (float(kill) / float(death));
    return 
kd;
}

new 
Float:Mykd GetKillDeath(killdeath); 

Last edited by lingzhidiyu; 01-25-2015 at 01:57.
lingzhidiyu is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-25-2015 , 03:40   Re: stock retrun float tag mismatch
Reply With Quote #2

PHP Code:
stock Float:GetKillDeath(killdeath)
{
    return (
float(kill) / float(death);
}

new 
Float:Mykd GetKillDeath(killdeath); 
__________________

Last edited by Chdata; 01-25-2015 at 03:40.
Chdata is offline
m_bNightstalker
Senior Member
Join Date: Jan 2015
Location: JWD
Old 01-25-2015 , 04:53   Re: stock retrun float tag mismatch
Reply With Quote #3

PHP Code:
stock Float:GetKillDeath(killdeath)
{
    return 
death == float(kill) : float(kill) / float(death);
}

new 
Float:Mykd GetKillDeath(killdeath); 

Last edited by m_bNightstalker; 01-25-2015 at 05:14.
m_bNightstalker is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 01-25-2015 , 05:03   Re: stock retrun float tag mismatch
Reply With Quote #4

Add a float tag to the function's definition.
Code:
stock Float:GetKillDeath(kill, death)
@Chdata & @m_bNightstalker
You might want to check that your example code compiles before posting it.
__________________

Last edited by Impact123; 01-25-2015 at 05:06.
Impact123 is offline
m_bNightstalker
Senior Member
Join Date: Jan 2015
Location: JWD
Old 01-25-2015 , 05:15   Re: stock retrun float tag mismatch
Reply With Quote #5

edited
m_bNightstalker 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 15:57.


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