CLEO Help Command Sampfuncs

CLEO related
Status
Not open for further replies.

Edd004

Active member
Joined
Mar 10, 2013
Messages
155
Reaction score
0
:stoned: All my cleo with command activation are crashed with sampfuncs v3.1++  :lol:
so  :me_gusta: how to fix this?  :dont_care: what should i do to my script?
 

Crokit

Active member
Joined
Jun 20, 2014
Messages
37
Reaction score
0
springfield link said:
Commands changed in 3.0+, you can't use loops or jf/jump inside a command label.
so how 2 add a condition that... oky example
same cmd for activation n deactivation
if player not in car print "u are not in car"
and if he is then perform command to idk type "u are in a car"

idk if its possible anymore?
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
@Crookit
Code:
if player_in_car
then do_shit
else say "ur not in a fuckin' car"
end

[member=516]Edd004[/member], post some of those activation commands here. Or try to rewrite them.
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
Crokit link said:
[quote author=springfield link=topic=7890.msg45059#msg45059 date=1403525314]
Commands changed in 3.0+, you can't use loops or jf/jump inside a command label.
so how 2 add a condition that... oky example
same cmd for activation n deactivation
if player not in car print "u are not in car"
and if he is then perform command to idk type "u are in a car"

idk if its possible anymore?
[/quote]

You can still use loops and jf @ and jump @.

:TOG
IF
00DF:  actor $PLAYER_ACTOR driving
THEN
    0AF8: ADD_CHAT_MSG "YOU'RE DRIVING!" color 0xFFFFFF
    ELSE
    0AF8: ADD_CHAT_MSG "YOU'RE NOT DRIVING!" color 0xFFFFFF
END
0B43: CMD_RETRN
 

Crokit

Active member
Joined
Jun 20, 2014
Messages
37
Reaction score
0
but like this

Code:
0B34: samp register_client_command "CarThing" to_label @Car


WHILE TRUE
wait 0
if 0@ == 1
then
    0000: NOP
end
END

:Car
0B12: 0@ = 0@ XOR 1
if and
   Player.Defined($PLAYER_ACTOR)
   Actor.Driving($PLAYER_ACTOR)
then   
    if 
    0@ == 1
    then 
    03C0: $car = actor $PLAYER_ACTOR car 
    036A: put_actor $PLAYER_ACTOR in_car $car
    else 
    072B: put_actor $PLAYER_ACTOR into_car $car passengerseat 1
    0430: put_actor $PLAYER_ACTOR into_car $car passenger_seat 1
    end
end    
jf @NotInCar    
0B43: samp cmd_ret

:NotInCar
wait 0
0AF8: samp add_message_to_chat "U r not in car" color 0xFFFF00
SAMP.CmdRet

?
 

Crokit

Active member
Joined
Jun 20, 2014
Messages
37
Reaction score
0
springfield link said:
No, that's pure shit, replace the 'jf' with 'else' and add after else the text. No need for another thread.
yes, thx, but what Im trying to ask: there are no more jumps? only "else"? we cant jump anymore?
 

Edd004

Active member
Joined
Mar 10, 2013
Messages
155
Reaction score
0
i got crash when i do something like this

:A
wait 0
text "cmon get a car bijes!" 2727
if
Actor.Driving($PLAYER_ACTOR)
jf @A
text "k" 2232
Samp.CmdRet()

it will crash when it jump back to the A  :yesyes:

are there any method to fix this(or do something like this) ?  :me_gusta:
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
You can't have loops in a command thread.

:A
text "cmon get a car bijes!" 2727
if Actor.Driving($PLAYER_ACTOR)
then text "k" 2232
else text "you're not in a car" 2121
end
Samp.CmdRet()


Commands read from start to end, you can't jump backwards or make a loop in thread.
 

Edd004

Active member
Joined
Mar 10, 2013
Messages
155
Reaction score
0
okay no more crash  :urtheman:
but I still have problem with this one  :dont_care:

The script :-
{$CLEO}
0000:
thread "uhe"

0B34: samp register_client_command "nick" to_label [member=13292]Nick[/member]

:WOOP
wait 0 
jump @WOOP

:NICK 
wait 0
0B35: samp 0@ = get_last_command_params
SAMP.Disconnect(0)
0B29: samp set_local_name "%s" 0@
0AF8: samp add_message_to_chat "Name Changed to '%s'" color 0xCCFF99 0@
wait 1
0B27: samp set_gamestate 1           
Samp.CmdRet()

// where's the problem?  :sweet_jesus:

it crash when i type /nick  :eek:hgodwhy:
 
Status
Not open for further replies.
Top