CLEO Help Help me /settime /setweather

CLEO related
Status
Not open for further replies.

Koolz

Member
Joined
Aug 20, 2020
Messages
17
Reaction score
0
Location
USA
* Name of the mod (if the mod doesn't exist, you don't have to tell one): /settime /setweather
* Where you saw it (not the server, we mean if you saw any videos/screenshots about it or not):
* What do you want (the most important part, explain this carefully) : i want at version 0.3dl and not need sampfuncs
* Details (add more details to your request) : N/A
* On/off key (specify it): Activate by typing /settime /setweather
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
165
Location
Poland
SA:MP 0.3.7-R4
SetTime.cs
Code:
{$CLEO .cs}

0000: NOP

wait 10000

00BF: 7@ = current_time_hours, 6@ = current_time_minutes

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AB1: @GetLastSentTextFromChatBox 0 _Return: Command 0@ Text 1@
    if 0AD4: $NOT_USED = scan_string 1@ format "/settime %d" 2@
    then
        if not 2@ > 24
        then
            0085: 4@ = 2@ // copy to save time which was entered for later
            5@ = true // enable and make infinity loop to set time every ms
        end
    else
        if 0AD4: $NOT_USED = scan_string 1@ format "/settime"
        then
            0085: 4@ = 7@ // set variable 4@ to default server time which was when you entered to server
        end
    end
end

if 5@ == true
then 00C0: set_current_time_hours_to 4@ minutes_to 0
end

end

:GetLastSentTextFromChatBox
{
    0.3.7 - R4
    0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
}
if 0AA2: 2@ = "samp.dll"
then        
    0A8E: 3@ = 2@ + 0x26E9FC
    0A8D: 3@ = readMem 3@ sz 4 vp 0
    0A8E: 4@ = 3@ + 0x14E5 // command
    0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5@
SetWeather.cs
Code:
{$CLEO .cs}

0000: NOP

wait 10000

while true
wait 0

if 0256:   player $PLAYER_CHAR defined
then
    0AB1: @GetLastSentTextFromChatBox 0 _Return: Command 0@ Text 1@
    if 0AD4: $NOT_USED = scan_string 1@ format "/setweather %d" 3@
    then
        if and
        not 3@ < 0
        not 3@ > 45
        then
            0A8C: write_memory 0xC81320 size 4 value 3@ virtual_protect 0
        end
    end
end

end

:GetLastSentTextFromChatBox
{
    0.3.7 - R4
    0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
}
if 0AA2: 2@ = "samp.dll"
then         
    0A8E: 3@ = 2@ + 0x26E9FC
    0A8D: 3@ = readMem 3@ sz 4 vp 0
    0A8E: 4@ = 3@ + 0x14E5 // command
    0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5@
 

Attachments

  • settime.cs
    18.6 KB · Views: 36
  • setweather.cs
    18.1 KB · Views: 35
Status
Not open for further replies.
Top