Raised This Month: $ Target: $400
 0% 

How can i get the spawned tank game id


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lovemf
BANNED
Join Date: May 2009
Old 07-04-2009 , 07:49   How can i get the spawned tank game id
Reply With Quote #1

i want make a plug,when spawned a tank give this tank red color.

but i don't know how can i get the spawned tank game id.

sorry my bad english.please help me ,thanks.
lovemf is offline
lovemf
BANNED
Join Date: May 2009
Old 07-04-2009 , 07:53   Re: How can i get the spawned tank game id
Reply With Quote #2

Code:
new client = GetClientOfUserId(GetEventInt(event, "userid"));
i found this right ?
lovemf is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-04-2009 , 09:13   Re: How can i get the spawned tank game id
Reply With Quote #3

Nono, this:

PHP Code:
  new clientid GetEventInt(event"userid");
  new 
client GetClientOfUserId(tankid); 
This will allow you to use the clientid for something else if you need it.

Though (and I'm not sure about this), I think you'd have to get the entity of the tank the player is actually controlling and color THAT.

Last edited by Dragonshadow; 07-04-2009 at 09:21.
Dragonshadow is offline
lovemf
BANNED
Join Date: May 2009
Old 07-04-2009 , 09:52   Re: How can i get the spawned tank game id
Reply With Quote #4

Quote:
Originally Posted by Dragonshadow View Post
Nono, this:

PHP Code:
  new clientid GetEventInt(event"userid");
  new 
client GetClientOfUserId(tankid); 
This will allow you to use the clientid for something else if you need it.

Though (and I'm not sure about this), I think you'd have to get the entity of the tank the player is actually controlling and color THAT.
thanks.

i try this

new tankid = GetEventInt(event, "tankid");
SetEntityRenderColor(tankid, 128, 0, 0, 255);

but can't i will try you code thanks
lovemf is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-04-2009 , 10:09   Re: How can i get the spawned tank game id
Reply With Quote #5

Quote:
Originally Posted by lovemf View Post
thanks.

i try this

new tankid = GetEventInt(event, "tankid");
SetEntityRenderColor(tankid, 128, 0, 0, 255);

but can't i will try you code thanks

You can try using IsValidEdict to check if its a valid entity (I think thats how it works anyway)
And I think you may need to use SetEntityRenderMode instead of SetEntityRenderColor

Last edited by Dragonshadow; 07-04-2009 at 10:16.
Dragonshadow is offline
lovemf
BANNED
Join Date: May 2009
Old 07-04-2009 , 10:19   Re: How can i get the spawned tank game id
Reply With Quote #6

thank you Dragonshadow,i search "tankid"

SetEntityColor() function would take care of that

http://forums.alliedmods.net/showthr...ghlight=tankid
lovemf is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 07-04-2009 , 12:07   Re: How can i get the spawned tank game id
Reply With Quote #7

Quote:
Originally Posted by Dragonshadow View Post
Nono, this:

PHP Code:
  new clientid GetEventInt(event"userid");
  new 
client GetClientOfUserId(tankid); 
This will allow you to use the clientid for something else if you need it.

Though (and I'm not sure about this), I think you'd have to get the entity of the tank the player is actually controlling and color THAT.
There is no difference. But lovemf's code looks more clear.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-04-2009 , 12:11   Re: How can i get the spawned tank game id
Reply With Quote #8

Quote:
Originally Posted by exvel View Post
There is no difference. But lovemf's code looks more clear.
Hey thats just how I learned to do it through reading the wiki etc ;)
Dragonshadow 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 18:54.


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