AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   a problem with else (https://forums.alliedmods.net/showthread.php?t=26664)

wonsae 04-06-2006 22:51

a problem with else
 
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 }

[ --<-@ ] Black Rose 04-07-2006 11:31

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)

Xanimos 04-07-2006 14:17

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)

wonsae 04-07-2006 15:53

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 04-09-2006 11:31

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]

[ --<-@ ] Black Rose 04-09-2006 16:18

lol?
neither would compile

wonsae 04-09-2006 17:40

Quote:

Originally Posted by [ --<-@
Black Rose]lol?
neither would compile

err the first one compiles..

ops i frogot the last " after %s


All times are GMT -4. The time now is 16:30.

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