Jump to content
Hostul a fost schimbat. Daca vedeti serverul offline readaugati rpg.b-zone.ro sau 141.95.124.78:7777 in clientul de sa-mp ×

Comandă Sanny Builder


Madalin

Recommended Posts

2 minutes ago, Madalin said:

Salut, doresc să fac o comandă care să ofere [/deliver id 100] jucătorilor din zonă, nu prea am habar ce ar trebui să folosesc :P

 

@shanker', am văzut ceva asemănător la ganghelp-ul tău, dacă mă poţi ajuta când ai timp, :D

Ce face deliver?

Ce reprezintă 100?

Link to comment
Share on other sites

1 minute ago, Madalin said:

Oferă un ziar unui jucător, suma de bani.

0B34: samp register_client_command "Ziare" to_label @Ziare

while true
    wait 0

    if 0@ == 1
    then
        0@ = 0
        
        for 1@ = 0 to 999
            if SAMP.IsPlayerConnected(1@)
            then
                2@ = SAMP.GetActorHandleByPlayerID(1@)
                00A0: store_actor 2@ position_to 3@ 4@ 5@
                00A0: store_actor $PLAYER_ACTOR position_to 6@ 7@ 8@
                050A: 9@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 6@ 7@ 8@
                if not 9@ > 15.0
                then say "/deliver %d 100" 1@
                end
            end
        end
    end
end

:Ziare
0@ = 1
0B43: samp cmd_ret

 

Link to comment
Share on other sites

1 minute ago, shanker' said:

0B34: samp register_client_command "Ziare" to_label @Ziare

while true
    wait 0

    if 0@ == 1
    then
        0@ = 0
        
        for 1@ = 0 to 999
            if SAMP.IsPlayerConnected(1@)
            then
                2@ = SAMP.GetActorHandleByPlayerID(1@)
                00A0: store_actor 2@ position_to 3@ 4@ 5@
                00A0: store_actor $PLAYER_ACTOR position_to 6@ 7@ 8@
                050A: 9@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 6@ 7@ 8@
                if not 9@ > 15.0
                then say "/deliver %d 100" 1@
                end
            end
        end
    end
end

:Ziare
0@ = 1
0B43: samp cmd_ret

 

Wow, nu mă asteptam asa repede =))

 

Se poate T/C.

Link to comment
Share on other sites

5 minutes ago, Madalin said:

Îmi dă crash :P

{$CLEO}

0000:

repeat
    wait 0
until 0AFA:

0B34: samp register_client_command "Ziare" to_label @Ziare

while true
    wait 0

    if 0@ == 1
    then
        0@ = 0
        
        for 1@ = 0 to 999
            if SAMP.IsPlayerConnected(1@)
            then
                2@ = SAMP.GetActorHandleByPlayerID(1@)
                if 056D:   actor 2@ defined
                then
                    00A0: store_actor 2@ position_to 3@ 4@ 5@
                    00A0: store_actor $PLAYER_ACTOR position_to 6@ 7@ 8@
                    050A: 9@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 6@ 7@ 8@
                    if not 9@ > 15.0
                    then say "/deliver %d 100" 1@
                    end
                    wait 500
                end
            end
        end
    end
end

:Ziare
0@ = 1
0B43: samp cmd_ret

Vezi acum (mai facem si noi posturi, shh)

Link to comment
Share on other sites

2 minutes ago, shanker' said:

{$CLEO}

0000:

repeat
    wait 0
until 0AFA:

0B34: samp register_client_command "Ziare" to_label @Ziare

while true
    wait 0

    if 0@ == 1
    then
        0@ = 0
        
        for 1@ = 0 to 999
            if SAMP.IsPlayerConnected(1@)
            then
                2@ = SAMP.GetActorHandleByPlayerID(1@)
                if 056D:   actor 2@ defined
                then
                    00A0: store_actor 2@ position_to 3@ 4@ 5@
                    00A0: store_actor $PLAYER_ACTOR position_to 6@ 7@ 8@
                    050A: 9@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 6@ 7@ 8@
                    if not 9@ > 15.0
                    then say "/deliver %d 100" 1@
                    end
                    wait 500
                end
            end
        end
    end
end

:Ziare
0@ = 1
0B43: samp cmd_ret

Vezi acum (mai facem si noi posturi, shh)

Dacă poţi să mi-o dai ca pe comandă, gen ca s-o pot pune pe la sfârsitul modului, că dacă o pun prima, nu ar mai merge [/getrp] si [/giverp]

Link to comment
Share on other sites

2 minutes ago, Madalin said:

Dacă poţi să mi-o dai ca pe comandă, gen ca s-o pot pune pe la sfârsitul modului, că dacă o pun prima, nu ar mai merge [/getrp] si [/giverp]

Nu exista asa ceva, intr-un label nu se poate folosi wait

 

Ti-am unit modurile mai jos

 

{$CLEO}

0000:

repeat
    wait 0
until 0AFA:

0B63: samp unregister_client_command "getNews"
0B63: samp unregister_client_command "putNews"
0B34: samp register_client_command "getNews" to_label @getNews
0B34: samp register_client_command "putNews" to_label @putNews

Alloc 25@ = 1000
Alloc 26@ = 1000

0B34: samp register_client_command "Ziare" to_label @Ziare

while true
    wait 0

    if 0@ == 1
    then
        0@ = 0
        
        for 1@ = 0 to 999
            if SAMP.IsPlayerConnected(1@)
            then
                2@ = SAMP.GetActorHandleByPlayerID(1@)
                if 056D:   actor 2@ defined
                then
                    00A0: store_actor 2@ position_to 3@ 4@ 5@
                    00A0: store_actor $PLAYER_ACTOR position_to 6@ 7@ 8@
                    050A: 9@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 6@ 7@ 8@
                    if not 9@ > 15.0
                    then say "/deliver %d 100" 1@
                    end
                    wait 500
                end
            end
        end
    end
    
    if 15@ == 1
    then
        15@ = 0
        if 0AAB:   file_exists "CLEO\Anunturi.txt"
        then      
            1@ += 1
            0209: 2@ = random_int_in_ranges 1 1@
            0AC8: 3@ = allocate_memory_size 666
            0AD3: 3@ = format "[Anuntul %d]" 2@
            
            chatmsg "{e8b72e}Anuntul %d" -1 2@
            4@ = File.Open("CLEO\Anunturi.txt", "rt+")
            repeat
                wait 0
                Alloc 5@ = 600
                File.ReadString(4@, 5@, 600)
                
                if 0C29: 33@ = stristr string1 5@ string2 3@
                then 
                    File.ReadString(4@, 5@, 600)
                    if or
                        0C29: 33@ = stristr string1 5@ string2 "Randuri]"
                        0C29: 33@ = stristr string1 5@ string2 "Randuri"
                    then
                        Alloc 6@ = 600
                        File.ReadString(4@, 5@, 600)
                        File.ReadString(4@, 6@, 600)
                        0AD3: 25@ = format "%s" 5@
                        0AD3: 26@ = format "%s" 6@
                        chatmsg 25@ -1
                        chatmsg 26@ -1
                        Free 6@
                        27@ = 2
                    else 
                        27@ = 1
                        0AD3: 25@ = format "%s" 5@
                        chatmsg 25@ -1
                    end
                end
                
                Free 5@
            until File.EOF(4@)
            File.Close(4@)
            
            0AC9: free_allocated_memory 3@
            
        else chatmsg "Eroare - nu am putut gasi fisierul cu anunturi." -1
        end   
    end
end

:Ziare
0@ = 1
0B43: samp cmd_ret

:getNews
SAMP.IsCommandTyped(0@)
if 0AD4: 33@ = scan_string 0@ format "%d" 1@
then 15@ = 1
else chatmsg "Introdu numarul de anunturi din fisierul cu anunturi" -1
end
0B43: samp cmd_ret

:putNews
IF 27@ == 1
then say "/news %s" 25@
else 
    say "/news %s" 25@
    say "/news %s" 26@
end
0B43: samp cmd_ret

 

Link to comment
Share on other sites

8 minutes ago, shanker' said:

Nu exista asa ceva, intr-un label nu se poate folosi wait

 

Ti-am unit modurile mai jos

 


{$CLEO}

0000:

repeat
    wait 0
until 0AFA:

0B63: samp unregister_client_command "getNews"
0B63: samp unregister_client_command "putNews"
0B34: samp register_client_command "getNews" to_label @getNews
0B34: samp register_client_command "putNews" to_label @putNews

Alloc 25@ = 1000
Alloc 26@ = 1000

0B34: samp register_client_command "Ziare" to_label @Ziare

while true
    wait 0

    if 0@ == 1
    then
        0@ = 0
        
        for 1@ = 0 to 999
            if SAMP.IsPlayerConnected(1@)
            then
                2@ = SAMP.GetActorHandleByPlayerID(1@)
                if 056D:   actor 2@ defined
                then
                    00A0: store_actor 2@ position_to 3@ 4@ 5@
                    00A0: store_actor $PLAYER_ACTOR position_to 6@ 7@ 8@
                    050A: 9@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 6@ 7@ 8@
                    if not 9@ > 15.0
                    then say "/deliver %d 100" 1@
                    end
                    wait 500
                end
            end
        end
    end
    
    if 15@ == 1
    then
        15@ = 0
        if 0AAB:   file_exists "CLEO\Anunturi.txt"
        then      
            1@ += 1
            0209: 2@ = random_int_in_ranges 1 1@
            0AC8: 3@ = allocate_memory_size 666
            0AD3: 3@ = format "[Anuntul %d]" 2@
            
            chatmsg "{e8b72e}Anuntul %d" -1 2@
            4@ = File.Open("CLEO\Anunturi.txt", "rt+")
            repeat
                wait 0
                Alloc 5@ = 600
                File.ReadString(4@, 5@, 600)
                
                if 0C29: 33@ = stristr string1 5@ string2 3@
                then 
                    File.ReadString(4@, 5@, 600)
                    if or
                        0C29: 33@ = stristr string1 5@ string2 "Randuri]"
                        0C29: 33@ = stristr string1 5@ string2 "Randuri"
                    then
                        Alloc 6@ = 600
                        File.ReadString(4@, 5@, 600)
                        File.ReadString(4@, 6@, 600)
                        0AD3: 25@ = format "%s" 5@
                        0AD3: 26@ = format "%s" 6@
                        chatmsg 25@ -1
                        chatmsg 26@ -1
                        Free 6@
                        27@ = 2
                    else 
                        27@ = 1
                        0AD3: 25@ = format "%s" 5@
                        chatmsg 25@ -1
                    end
                end
                
                Free 5@
            until File.EOF(4@)
            File.Close(4@)
            
            0AC9: free_allocated_memory 3@
            
        else chatmsg "Eroare - nu am putut gasi fisierul cu anunturi." -1
        end   
    end
end

:Ziare
0@ = 1
0B43: samp cmd_ret

:getNews
SAMP.IsCommandTyped(0@)
if 0AD4: 33@ = scan_string 0@ format "%d" 1@
then 15@ = 1
else chatmsg "Introdu numarul de anunturi din fisierul cu anunturi" -1
end
0B43: samp cmd_ret

:putNews
IF 27@ == 1
then say "/news %s" 25@
else 
    say "/news %s" 25@
    say "/news %s" 26@
end
0B43: samp cmd_ret

 

Merge, mulţumesc mult! ❤️

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.