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

Code doesn't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
UchihaSkills
Senior Member
Join Date: May 2013
Location: Germany
Old 07-07-2013 , 06:09   Code doesn't work
Reply With Quote #1

Hey why isnt this code working?

PHP Code:
public CmdShow(id)
{
    new 
Float:Bitcs;
    
pev0pev_maxspeedBitcs );
    
client_printidprint_chat"%4.1f"Bitcs );

UchihaSkills is offline
Old 07-07-2013, 06:10
Serkan Kischa
This message has been deleted by YamiKaitou. Reason: https://forums.alliedmods.net/misc.php?do=showrules
Old 07-07-2013, 06:20
UchihaSkills
This message has been deleted by YamiKaitou. Reason: reply to deleted post
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-07-2013 , 06:22   Re: Code doesn't work
Reply With Quote #2

Why do you use 0 and not id?
mottzi is offline
Send a message via MSN to mottzi
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2013 , 06:24   Re: Code doesn't work
Reply With Quote #3

0 is world, pev->maxspeed is not used for it
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
UchihaSkills
Senior Member
Join Date: May 2013
Location: Germany
Old 07-07-2013 , 06:25   Re: Code doesn't work
Reply With Quote #4

so i have to use
PHP Code:
public CmdShow(id)
{
    new 
Float:Bitcs;
    
pevidpev_maxspeedBitcs );
    
client_printidprint_chat"%4.1f"Bitcs );


Last edited by UchihaSkills; 07-07-2013 at 06:25.
UchihaSkills is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2013 , 06:31   Re: Code doesn't work
Reply With Quote #5

Yes

Or :

PHP Code:
public CmdShow(id)
{
    
client_printidprint_chat"%4.1f"get_user_maxspeedid ) );

or

PHP Code:
public CmdShow(id)
{
    
client_printidprint_chat"%4.1f"entity_get_floatidEV_FL_maxspeed ) );

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-07-2013 at 06:32.
ConnorMcLeod is offline
UchihaSkills
Senior Member
Join Date: May 2013
Location: Germany
Old 07-07-2013 , 06:40   Re: Code doesn't work
Reply With Quote #6

Why is it better to use entity_get_float ?
UchihaSkills is offline
Old 07-07-2013, 09:35
Serkan Kischa
This message has been deleted by Arkshine. Reason: That's the purpose of this section. I warn you, don't insult again.
Old 07-07-2013, 09:37
Serkan Kischa
This message has been deleted by Arkshine. Reason: Last warning. Don't insult, have a proper behavior.
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-07-2013 , 09:39   Re: Code doesn't work
Reply With Quote #7

Use first. entity_get_float() has to handle more code, and even though it doesn't make really a difference, better to use native which does directly the job, so get_user_maxspeed().
__________________
Arkshine is offline
Old 07-07-2013, 09:40
Serkan Kischa
This message has been deleted by Arkshine. Reason: Pointless post. Don't post again to answer things unrelated to thread.
UchihaSkills
Senior Member
Join Date: May 2013
Location: Germany
Old 07-07-2013 , 09:44   Re: Code doesn't work
Reply With Quote #8

Thanks arkshine and connor, i think i got it now
UchihaSkills is offline
Old 07-07-2013, 10:10
Serkan Kischa
This message has been deleted by YamiKaitou. Reason: https://forums.alliedmods.net/misc.php?do=showrules
Old 07-07-2013, 10:12
Serkan Kischa
This message has been deleted by Arkshine. Reason: https://forums.alliedmods.net/misc.php?do=showrules
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-07-2013 , 14:21   Re: Code doesn't work
Reply With Quote #9

Sorry for offtopic.

Quote:
Originally Posted by Arkshine View Post
Use first. entity_get_float() has to handle more code
What it's the "more code" ?
For example: it these case it's not better to use entity_get_float() instead of pev() ?
Fakemeta have all pev_ values in pev() function and Engine have function in grouped in entity_get_int; entity_get_vector; entity_get_edict; etc. so it's not a little better engine because have all those functions grouped ?
dFF is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2013 , 14:29   Re: Code doesn't work
Reply With Quote #10

He was talking about get_user_maxspeed against entity_get_float.

get_user_maxspeed is better than entity_get_float, and entity_get_float is better than pev, but again, this is trivial, the 3 ways are ok, well coded code with pev is better than feet (french expression) coded code with get_user_maxspeed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 08:07.


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