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

registering a Steam:id to a car


Post New Thread Reply   
 
Thread Tools Display Modes
Rixorster
Senior Member
Join Date: Jul 2005
Old 05-11-2006 , 06:34  
Reply With Quote #31

Hmm, lemme try to fix it...(i'm at school, so don't expect any good results right now =D )
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
EVILX
Junior Member
Join Date: May 2006
Old 05-11-2006 , 07:51  
Reply With Quote #32

well im at school to.
EVILX is offline
EVILX
Junior Member
Join Date: May 2006
Old 05-11-2006 , 14:31  
Reply With Quote #33

ok well ok this is what im wondering i wonder if i could get a new command (/regcar) so i can go up to a car and type /regcar and it would register my steam_ID to that car and store it into the Carfile.ini so when the server restarted it still in they at the location it is stored to.

plus an /unregcar incase i want to sell it.
EVILX is offline
EVILX
Junior Member
Join Date: May 2006
Old 05-12-2006 , 03:02  
Reply With Quote #34

ok i need a little help i made a /regcar function and i need a little help.

when i type regcar it works the car becomes mine but... it still says the car is owned by 0. and if someone else types /regcar the car steal the car. so they are the two problems heres the code the /regcar

Code:
public registercar(id) {     new szFilename[64]       get_cvar_string("rp_carsfile",szFilename,63)     new name[64]       get_user_name(id,name,63)       new message[300]     carOwner[id] = get_user_authid(id,steamid,43)     format(message,299,"[CarMod] %s has registered the car.",name)     overhear(id,300,message)       client_print(id,print_chat,"[CarMod] You have Registered the car.")     return PLUGIN_HANDLED   }
EVILX is offline
Sandurr
Senior Member
Join Date: Aug 2005
Old 05-12-2006 , 05:39  
Reply With Quote #35

Quote:
Originally Posted by EVILX
ok, this is what i have now.

Code:
public leaveCar(id)   {     carOwner[id] = get_user_authid(id,steamid,43)   }   public getInCar(id)   {     tryingToCar[id] = get_user_authid(id,steamid2,43)     if( tryingToCar[id] == carOwner[id] )   client_print(id,print_chat,"You'r not the owner of this vechile!")     }     public letInCarFunction(id) {   carOwner[id]= get_user_authid(id,steamid,43)   client_print(id,print_chat,"[CarMod] You have turned on your engine and got out of the car.")   }

but doesn't work..... any help please...
"[CarMod] You have turned on your engine and got out of the car."

Sandurr is offline
EVILX
Junior Member
Join Date: May 2006
Old 05-12-2006 , 07:52  
Reply With Quote #36

so need to put that code in and that right?
EVILX is offline
Rixorster
Senior Member
Join Date: Jul 2005
Old 05-12-2006 , 09:35  
Reply With Quote #37

EVILX, you made that register code the wrong way, first of all, change the rp_carsfile... Like right now, it saves the car spawning in the same file as your steamid's, so you've done it totally the wrong way <_< Ill fix it later, when i have time.
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
EVILX
Junior Member
Join Date: May 2006
Old 05-12-2006 , 10:40  
Reply With Quote #38

well ok thanks did say im a newb and coding

at least im atemping to try
EVILX is offline
EVILX
Junior Member
Join Date: May 2006
Old 05-14-2006 , 14:56  
Reply With Quote #39

*bump*

need help with this.
EVILX is offline
Fred Dawes
Junior Member
Join Date: May 2006
Old 05-15-2006 , 23:04  
Reply With Quote #40

What I did to get permanent owners was add a new field to the 'amx_createcar' command.

amx_createcar <model> <0/1 save> "<steamid>"

You needed the quotes. I just read the steamid to the car's target in

Code:
new authid[31] ----------------------------- read_argv(6, authid, 31) ----------------------------- entity_set_string(carout[id],EV_SZ_target,authid)

...and checked it on the touch where you get in the car...

Code:
public setcar(entid,id) {    if(allow[id] != 0) return PLUGIN_HANDLED    if(incar[id] != 0) return PLUGIN_HANDLED    new locked[33], authid[33]    entity_get_string(entid,EV_SZ_target,locked,32)    get_user_authid(id,authid,32)    if(equal(locked,authid)) {}    else{       client_print(id,print_chat,"This car is reserved for %s, you are %s",locked,authid)       allow[id] = 1       set_task(5.0,"allowhim",id)       return PLUGIN_HANDLED    }

Hope this helps. BTW, if you want to see the rest of my carmod, you can check out my TS server 'Dawes and Company'.
Fred Dawes 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:38.


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