#1 11-05-2010 00:29

DJZybez
Registered: 11-05-2010
Posts: 2

First Script - Not Working?

Hey guys I made this really simple bit of code that should make the player's wanted level 1 when he holds the '5' button (Dec 53) for a whole second. It crashes when it's held for 1 second. What am I doing wrong?

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .CS}

//-------------MAIN---------------
thread 'NOWANT'

:NOWANT_11
wait 1000
if
0AB0:   key_pressed 53
else_jump @NOWANT_11
010D: set_player $PLAYER_CHAR wanted_level_to 1

Offline

#2 11-05-2010 02:06

Den_spb
From: Ленинград
Registered: 23-11-2008
Posts: 941
Website

Re: First Script - Not Working?

1. You should use command of finishing script (0A93) or do never-ending cycle (if script must work many times).
2. You should test, is player defined, before realize something about him.

{$CLEO}
:NOWANT_11
wait 1000
player.Defined($player_char)
else_jump @NOWANT_11
0AB0:   key_pressed 53
else_jump @NOWANT_11
010D: set_player $PLAYER_CHAR wanted_level_to 1
jump @NOWANT_11

Offline

Board footer

Powered by FluxBB