Ayamabi
Active member
- Joined
- Mar 8, 2018
- Messages
- 169
- Reaction score
- 111
Hello, i wanted to create something like friend checker and i actually did something but i have problem writing to a new line in ini file here's my code
so code above will create friend_= "PLAYER NAME GET BY ID" in ini file but everytime when i type /fadd <id> it overwrites that line and deletes previous friend name but i want to add new friend name into new line
if someone can post little explanation here i'll be very grateful
Code:
:{$CLEO}
0000:
alloc 0@ 100
0B6D: render 1@ = create_font "Arial" height 10 flags 0x1
0B34: "fadd" @FriendAdd
while true
wait 0
if 2@ == true
then
SAMP.IsCommandTyped(2@)
if
0AD4: 2@ = scan_string 2@ format "%d" 31@
if
SAMP.IsPlayerConnected(31@)
then
0B20: samp 3@ = actor_handle_by_samp_player_id 31@
0B36: samp 5@ = get_player_nickname 31@
if
0AAB: file_exists "CLEO\Friends.ini"
then
0AF5: write_string 5@ to_ini_file "cleo\Friends.ini" section "FriendList" key "friend_"
printf "Added %s" 1300 5@
else
printf "<<Friends Error>> Friends.ini not found!" 1300
end
else
printf "<<Friends Error>> Player isn't connected!" 1300
end
end
end
:FriendAdd
0B12: 2@ = 2@ XOR 1
cmdret
so code above will create friend_= "PLAYER NAME GET BY ID" in ini file but everytime when i type /fadd <id> it overwrites that line and deletes previous friend name but i want to add new friend name into new line
if someone can post little explanation here i'll be very grateful