• Breaking News

    Tuesday 30 May 2017

    First Tutorial: Getting Started


    Related image
    Hello and welcome to SAMP Scripting Tutorials Page. This is the first tutorial of SAMP Scripting.

    First of all, we will gather all the needed softwares for it:
    - SAMP Server (Download on official website)
    - PAWNO (will be included inside SAMP Server)

    Gathering Basic Info about callbacks, defines and other things can be done here:
    - https://forum.sa-mp.com
    - https://wiki.sa-mp.com

    Getting Started:
    - Download the official SAMP Server. Unpack it.
    - Open PAWNO from (/samp-server/pawno/pawno.exe) the server's directory.
    - Click open a file in the pawno.
    - Open "new.pwn (/samp-server/pawno/new.pwn) " with pawno.
    This is the clean script also known as scratch. Now we will code this.

    We will make a Freeroam script for now. By these following steps you can create your own scripts.
    1. We will add different skins in the selection menu.
    Search (Ctrl+F) for "AddPlayerClass", this means when a player connects what classes and skins he must see! That will be under "OnGameModeInit".
    After searching "AddPlayerClass", learn this:
    AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
    In the scratch script, there will be one Class / Skin added which is CJ's skin (Skin ID / Model ID 0).
    If you want to add more different skins, search for all skins of SAMP and their IDs and put them in the code.
    For Example, I put a Truth Skin in selection menu.
    AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
     1 is Skin / Model ID, 1958.33, 1343.12, 15.36, 269.15 are the cords (where the skin will spawn), 26 is weapon id and 36 is ammo of 26, 28 is weapon id and 150 is ammo of 28, 0 is weapon id and 0 is ammo of 0.
    So in this way, you can set that where what skin id can spawn and with what ammo of which weapons. Everything is almost self explanatory.

    No comments:

    Post a Comment

    Powered by Blogger.

    About

    This blog is created by JMR. Here you can get tutorials about San Andreas Multiplayer Scripting.
    You can get in touch with me using contact info.