Quantcast

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - remaked

Pages: [1]
1
Scripting / Begin your journey with Lua!
« on: September 30, 2020, 09:30:27 am »
Hello everyone, recently I've been receiving a few DM's about how to learn scripting etc..., so I decided to open this topic to maybe provide help to those who are willing to learn Lua and maybe push those who are just thinking about it and hesitating.

Part 1:

First of all, I can't explain better than those links, so you should read them carefully before reading the next part of this topic:

1- https://wiki.multitheftauto.com/wiki/Scripting_Introduction
2- https://www.lua.org/manual/5.1/
3- https://forum.mtasa.com/topic/34453-lua-tutorials-manuals/

After reading those links carefully, you should now know what 'debugging' is. Infact, debugging may help you fix the errors yourself 99% of the time, here is a link to know what debugging is:
- https://wiki.multitheftauto.com/wiki/Debugging

Now you can go ahead and save this link in your browser: https://wiki.multitheftauto.com/wiki/Main_Page

The last link is the most important of all, it's where you'll be looking every time you are making something(a script).


-------------------------------------------
Part 2: (Only read this if you totally understood/read Part 1)

Now, you should have a general idea about scripting/Lua, so we'll be making a couple scripts to get you started with.

We are gonna make a script which outputs "blabla logged in" whenever a player logs in, and another for when a player logs out.

First things first, we are gonna go here(https://wiki.multitheftauto.com/wiki/Server_Scripting_Events) and look for an event that triggers when a player logs in, which is gonna be "onPlayerLogin". Let's go:
Code: (Lua) [Select]
function playerLogin() -- function name should always be camel case(this is only for Lua)
local playerName = getPlayerName(source) -- get the name of the player who logged in with "getPlayerName"
outputChatBox("JOINQUIT: "..playerName.." has logged in!", root) -- We output a text to everyone online using "outputChatBox"
end
addEventHandler("onPlayerLogin", root, playerLogin) -- Our event handler which will trigger this function every time a player logs in

For when a player logs out, we will need an event for that, we go to wiki and we will find "onPlayerLogout", let's go:

Code: (Lua) [Select]
function playerLogout() -- function name should always be camel case(this is only for Lua)
local playerName = getPlayerName(source) -- Here we are getting the name of the player who logged out with "getPlayerName"
outputChatBox("JOINQUIT: "..playerName.." has logged out!", root) -- We output a text to everyone onine using "outputChatBox"
end
addEventHandler("onPlayerLogout", root, playerLogout) -- Our event which will trigger this function every time a player logs out

Now let's make a script which will give a random player 50,000$ everytime you type /giverandomcash and output a message to the random player to inform him about the money.
 
We go to the wiki(as always) and we search for a function to get a random player, which will be https://wiki.multitheftauto.com/wiki/GetRandomPlayer, and a function to give the player money, which will be https://wiki.multitheftauto.com/wiki/GivePlayerMoney, finally to inform we will use outputChatBox which we have seen earlier. Let's go!

Code: (Lua) [Select]
function giveRandomMoney(thePlayer, command)
local randomPlayer = getRandomPlayer() -- we get a random player
givePlayerMoney(randomPlayer, 50000) -- we give the money
outputChatBox("You got lucky and won 50,000$", randomPlayer, 0, 255, 0) -- we output a text to the player to inform him about the money
end
addCommandHandler("giverandomcash", giveRandomMoney) -- Our function will trigger once this you type this command

--------------------------------------
Part 3:
Here are two tasks for you to test yourself!
Task1:
- Make a script which removes the player's head once he executes the command '/head', and give it back again when he executes the same command.

Task 2:
- Create a pickup and make it that when a player enters the pickup, he will get 1,000$

You can then post your work here, same if you face any errors/questions, and someone(or me) will hopefully answer you

2
Account Retrieval / Account Recovery - Remaked
« on: September 02, 2020, 01:34:19 pm »
Account name: Remaked
Account serial:B008A0DC10E7F8AA1FD2AF0FCB762BF4
Any additional info: -

3
Ingame Name: Remaked
Forum Name: Remaked
Serial: B008A0DC10E7F8AA1FD2AF0FCB762BF4

Name of player you're complaining against: [GSF]Rustard(accname: Bata) / [GSF]RXXXDXXXR(accname: Hidden).
What rule have they broken: Random DM.
Date/Time the rule was broken: Just now.
Evidence of them breaking a rule: Album

NOTE: Check local chat and how they are spamming, if that's punishable I wouldn't mind muting them as well, thanks in advance.

4
The Landfill / Re: Suggestion for translators.
« on: February 08, 2017, 09:59:55 am »
Re-post it at the new topic.

5
Tunisian Board / Chniye el game multiplayer eli tel3abha
« on: February 08, 2017, 07:49:26 am »
Behy, hetha topic win kol wehed i9oul chniye el game multiplayer ( online ) eli yelaabha so belekchi nweliw neleebou games okhrin maa badhna.

estaamel format hetha:

Code: [Select]
[b]chniye el game?[/b]:
[b]Chnouwa esmek fel game?[/b]:
[b]3al PC wele console?[/b]:


6
Tunisian Board / IGC Rules bel tounsi.
« on: December 14, 2016, 04:22:01 pm »
El Rules el General mta3 IGC - IGC???????? ?????? ?

1.) Ihtaram El Players lokhrin - ????? ???????? ???????
Mata3malech hajet eli etthor biha el 3bad ellokhrin -  ?? ????? ????? ??? ???? ?????? ???????
Ma tekthebech 3la el 3ebed , ou ma t9alla9homch. - ?? ????? ??? ??????  ? ?? ???????
Saben el 3bad khasatan Dinou(Religion) , Jinsou, Bledou,3ayeltou,Tha9aftou,Aslou... mamnou3 ya3ni el rasicm mamnou3 - ?? ????? ?????? ? ?????? ??? ? ??? ???? ? ??? ????? ? ??? ????? ? ?????? ?? ??

2.) Ma tmesech el benya el tahtiya mta3 el server - ?? ???? ?????? ??????? ???????
Ki ta3mel hajet ta3rf enha tehlek ou tcrashi el server, forum, irc, TeamSpeak, MTA server tekel Ban permanent ma3neha ma yetnahach- ?? ???? ???? ???? ???? ???? ??????? ? ??? ????? ???? ? ??? ??????? ???????

3.) ma ta3melech advertisements- ?? ????? ????????? ? ?? ???????
"Advertisements" Howa el spam , ya3ni ma tespamich el chat eb hkeyet fer8a-?? ????? ?????? ?????
Forum:Ken el post mte3ek el lowel fil forum advertisements, ya3ni spam wailla tahki a3la hajet ma 3andha hatta 3ala9a bil server tetbana Forever.- ??? ?????? ????? ????? ??? ???????? ???? ???? ???? ??? ????


El Rules mta3 el forum - ?????? ???????

1.) El posts el kol lezem ykounou bil anglais - ??????? ???? ???? ?????? ???????????
Tnejem tahki lou8a okhra fi el "IGC in other languages" board-"IGC in other languages" ???? ???? ???? ???? ?? ????

2.) Kol Board fil forum 3andou el 9awanin mte3ou ou lezmek tehtaramhom- ??????? ??? ??????? ???? ????? ????????
Ahawka to tal9a post fi kol board fih el rules mte3ou.
Tehtaram el rules mta3 el boards kima mta3 el forum - ??? ?????? ?????? ?????? ???? ???? ???????? ??? ???????

3.) Ekteb el Topics fi board mte3hom el mounaseb- ????? ?? ??????  ???????
El topics eli fi blassa okhra lezem yhezouha lel Board el mounasseb

4.) Ken el fekra mouch mta3ek ekteb mta3 chkoun- ??? ???? ??? ??? ????? ??? ??? ????
Ken eli na9alt a3lih mayhebech el post mte3ek yetfasakh- ??? ??? ???? ???? ?????? ??? ?????? ?? ???? ?????? ?????
Kenek mna9el min servers,forums okhrin lezem tkoun enti eli ktebetha 8adi waila 3andek permission wadha min 3and eli 3malha

5.) Ma tspammich el forum wailla el inboxes mta3 el 3bed
Tspammi m3aneha tekteb hkeya fer8a waila tekteb nafs el chay fil blayes lokhrin, nafs el chay , ma lezmekech tab3eth messaget i9al9ou- ?? ????? ?????? ? ???? ?????


El rules mta3 el server - ?????? ????????

1.) Ma etdethmatchich el players waila tkasrelhom el kraheb mte3hom - ?? ??????????? ?????
Ma lezmekech tathreb el players illa itha howa may9al9ouch - ?? ?????? ????? ????? ?? ??? ??? ??? ??? ????? ???? ?? ???????
Boulisiya ki tathreb el criminals el wanted vise versa mohouch mamnou3 - ???? ????? ???? ???? ?????? ? ?? ????? ???? ????
Ki tebdaw etturfiw tnejemou tkartchou b3athkom - ???????? ?????? ????? ??????
Ki t3awen ashabek fi el 3ark mohouch deathmatch - ???? ????? ????? ?? ????? ??????
malezmekech todkhol fil kraheb mta3 lokhrin wra ba3thou ou bel3ani- ?? ????? ?? ????? ????? ???????
tathreb kraheb lokhrin ma8ir sbab mamnou3

2.) Ma t8ochech fil lo3ba.- ???? ?????
ki et cheati wailla et hacki tetbana - ?? ?????? ? ??? ??????
Ki tal9a bug reportih , ou ma testa3mlouch el salhek .- ?? ???? ???? ?? ?????? ???????
El bugs eli tal9aha etreportiha lel QCA members wailla tetbana
Ma testa3malech el mods elli y3awnouk akther min el nes lokhrin - ?? ??????? ????

3.) Ahki ken anglais fil "main chat" - ???? ????? ?????????? ????
Chat "t" ou el team chat ou el radio chat yetsamaw "Main Chat"
Tnejem tahki ey lou8a thebha fil local wailla fi el chat privé - ???? ?? ??? ?????? ?? ?????? ?????? ? ?????? ?????

4.) Ma lezmekech tegriefi - ?? ????? ????? ?? ?????? ? ????? ???????
Tegriefi ya3ni t9alle9 el nes , kima wa9telli tsaker el kayes wailla etayah el nes fil ma mamnou3

5.) el "Spam" mamnou3
Spammin ma3neha ki tebda t9oul ou t3awed fi nafes el haja kima ("noob,noob,noob,noob,noob") - ?????? ?????
Tahki bil MAJUSCULE zeda yetsama Spam

6.) EL "Impersonating" mamnou3- ?? ?????? ???? ??? ??? ?? ???
Impersonating ma3neha ki tekheth Tag mouch mte3ek wailla esem mta3 had ekhor ou hetha mamnou3

7.) El asami lezem ykounou ken bil Hrouf wailla nwamer mouch Roumouz- ?????? ?????? ? ??????? ???? ?? ????
Ki yebda esemk "(,{" mamnou3
3ayck @Hiccup

 

7
General Support / Architecture
« on: December 11, 2016, 10:54:54 am »
I can't apply to join Architecture team ? And if I can where and how. Thanks.

8
Tunisian Board / Suggestions & Faults
« on: December 12, 2016, 09:11:01 am »
Suggestions

Aandek suggestion nzidoha fel board ? Esta3mel format hetha ou posti.

Code: [Select]
[b]Chniye el suggestion[/b] :

[b]Fech bech taawena el suggestion hethi[/b] :
Faults

9it ey ghalta aamelha moderator f topic ? estaamel el format hetha.

Code: [Select]
[b]Link mtaa el topic eli fih el ghalta[/b] :

[b]Chniye el ghalta[/b] :

Pages: [1]
SimplePortal 2.3.7 © 2008-2021, SimplePortal