Raised This Month: $ Target: $400
 0% 

a problem with else


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 04-06-2006 , 22:51   a problem with else
Reply With Quote #1

hi i'm trying to make it so when the person is not incar he can spawn the car and when he is in car he exits the car but it does not spawn the car when the person is not incar
heres the code
Code:
public item_car(){     new arg[32], arg2[32], id, model     read_argv(1,arg,31)     read_argv(2,arg2,31)     id = str_to_num(arg)     model = str_to_num(arg2)     if(incar[id] == 0)     {         new player[33]         server_cmd("amx_createcar %s %s",model,player)         return PLUGIN_HANDLED     }     else     {         remove_entity(id)         client_print(id,print_chat,"[CarMod] You have exited your car.")     }     return PLUGIN_HANDLED }
wonsae is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 04-07-2006 , 11:31  
Reply With Quote #2

Code:
    new arg[32], arg2[32], id, model     read_argv(1,arg,31)     read_argv(2,arg2,31)     id = str_to_num(arg)     model = str_to_num(arg2)
-->
Code:
    new id[32], model[32]     read_argv(1,id,31)     read_argv(2,model,31)
[ --<-@ ] Black Rose is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 04-07-2006 , 14:17  
Reply With Quote #3

Code:
    new id[32], model[32]     read_argv(1,id,31)     read_argv(2,model,31)
--->
Code:
   new id , player[32] , model[32]     read_argv(1,player,31)     read_argv(2,model,31)     id = cmd_target(0 , player , 2)
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 04-07-2006 , 15:53  
Reply With Quote #4

Quote:
Originally Posted by Suicid3
Code:
    new id[32], model[32]     read_argv(1,id,31)     read_argv(2,model,31)
--->
Code:
   new id , player[32] , model[32]     read_argv(1,player,31)     read_argv(2,model,31)     id = cmd_target(0 , player , 2)
it's already targeted to the player with the amx_createcar command
wonsae is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 04-09-2006 , 11:31  
Reply With Quote #5

I think the problem is the amx_createcar command is it supposed to be


Code:
 server_cmd("amx_createcar %s %s,model,player)

or

Code:
 server_cmd("amx_createcar %s %s,model player)
[/small]
wonsae is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 04-09-2006 , 16:18  
Reply With Quote #6

lol?
neither would compile
[ --<-@ ] Black Rose is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 04-09-2006 , 17:40  
Reply With Quote #7

Quote:
Originally Posted by [ --<-@
Black Rose]lol?
neither would compile
err the first one compiles..

ops i frogot the last " after %s
wonsae is offline
Reply


Thread Tools
Display Modes

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 16:30.


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