[Tutorial] How to script,for new begginer scripters
#1

Ok,for start to script something you have to download folder with all stuff
Link: http://www.sa-mp.com/download.php
You receive a folder with all stuff what you will need to scrip also in folder there is some filterscrip which done for you like base.pwn ls_evelator.pwn etc.
For begin to script you have to do some change in your settings, for you should open server.cfg ( you can open with notepad or other word program ) and you will see like this
Код:
echo Executing Server Config...
lanmode 0
rcon_password <enter a password>
maxplayers 50
port 7777
hostname Blank
gamemode0 
filterscripts 
announce 1
query 1
weburl 
onfoot_rate 40
anticheat 0
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
1st.You have to change password of rcon_password to a password like 1337 or other password.
2nd.Maxplayers it's how much slots do you want to be in your server ( local )
3rd.Hostname enter your name of server
4th.Enter your name of gamemode ( later you will know what it's if you don't know )
Now your server can be open and test it ( if you not do them changes your server won't open )

GameMode
Gamemode is your server(s).After scripting a server (gamemode) you should enter in folder with name Gamemode.
For begin script you should open folder pawno which is in folder which you downloaded some time ago, and open pawno.exe
Do new file

and after save it in folder gamemode

Now you made your first script or better to say your gamemode
Now you can check it if work just enter your gamemode in sever.cfg like
Код:
gamemode0 myserver
Now you can edit your server how much time you want and how much enter in it like commands,timers,skins, etc
Open your server format .PWN NOT .AMX, .pwn is your method to script and after compline it in .amx which server reading it.
Basic for every begginer sciptes need just some skins for begin, for add skins you have to go to
pawn Код:
public OnGameModeInit()
{
return 1;
}
and write
pawn Код:
AddPlayerClass(skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
for example:
pawn Код:
public OnGameModeInit()
{
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}
For more information about ids of skins check it https://sampwiki.blast.hk/wiki/Skins:All
Now you made some skins for players
As usualy when you make new gamemode is written a camera look to a shit place and can't see what skin to choice it's can be solve, I advice you to add other place came look and choice the skins.For it you need to change at
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
Remove all what is written in OnPlayerRequestClass except return 1; and write a normally camera look, I give example:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}
Now it's a good camera look and player's position for choice a skin
You did a big work for at begin scripting and for finish your script you need to compile it

Compile is important for convert all what you script and check the mistake if you did.
And for every new begginer usualy want some vehicle for it you will learn new function
pawn Код:
CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
For see what ids of vehicles' model check it https://sampwiki.blast.hk/wiki/Vehicles:All
And colors here https://sampwiki.blast.hk/wiki/ColorID
But about coordenates ( x,y,z and angle ) you can get with samp's command /save.In game choice a place and do /save and you will receive coordenates,for check it go to
Код:
C:\Documents and Settings\Admin\My Documents\GTA San Andreas User Files\SAMP
and will see the savedpositions and open it. Will see like
Код:
AddPlayerClass(2,354.7001,169.0892,1008.3801,264.2526,0,0,0,0,0,0); //
and it's too a way to add more skins in some place.For get X,Y,Z and Angle from that you need just remove the first number it's can be from 0 to 299 and last 6 zeros ( sometime can something write replace zeros ), you get the X,Y,Z and Angle.
Other way to add vehicles is to download MTA program http://mtavc.com/ and work with it, all stuff what you will save you should convert in http://www.convertffs.com/ for more detals check others tutorials in ******* and ****** about MTA.
Ok, now you made a lot things for your new server
And for every new begginer scipter want a register and login system, well, there are a lot date of base to save player's stuff like dudb,Y_ini etc.The most used date base is dudb and Y_ini also is a lot tutorials of them date of base for save stuff for more information about date of base check this https://sampforum.blast.hk/showthread.php?tid=273088
Well, it's basical of a begginer scripter.
good luck to all new scripters and also you can found more tutorials here and in ****** http://lmgtfy.com/?q=tutorials+samp
Reply
#2

Please format your thread with important points and such. And also improve your grammar and the use of punctuation mark and caps.
Reply
#3

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Please format your thread with important points and such. And also improve your grammar and the use of punctuation mark and caps.
it's not the most important for a new scripter?
about grammar I'm lazy for correct my grammar mistakes
Reply
#4

Quote:
Originally Posted by mineralo
Посмотреть сообщение
it's not the most important for a new scripter?
about grammar I'm lazy for correct my grammar mistakes
If you are too lazy to mend your grammars, then why did you bother to make a thread?
Reply
#5

5.0/10
Reply
#6

sorry for I'm lazy but how you think it's good information for a new begginer scripter?
Reply
#7

Quote:

for start to script something you have to download folder with all stuff

*facepalm*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)