BREAKING NEWS

Welcome to File Townz | A TOWN Where you find all Files !

Search

Monday, 12 September 2016

Changing your SA-MP Font

Changing your SA-MP Font
First off, You would need to go into your documents folder and open up the "GTA San Andreas user files"

[Image: Zuqhu0q.jpg]

Step two, Enter the "SAMP" Folder, there you will find a file named as "sa-mp.cfg" open it with notepad

[Image: 2b4R4qE.jpg]

Final step, add a line to the bottom:- fontface="insertfont"
As an example, I use the font "Tahoma" in game so I just inserted fontface="tahoma"

[Image: v1cQjBd.png]

Click this to get a list of fonts

 http://en.wikipedia.org/wiki/List_of_typ...ft_Windows



PAWN for SA-MP in Notepad++

PAWN for SA-MP in Notepad++

Hey,
I made my own Notepad++ language/API for SA-MP scripting, follow these steps and you can have it too!
Here's an example on what it looks like:
[Image: autocomplete.gif]

Screenshot!

For those who aren't familiar with Notepad++, you can read about it & download here: http://notepad-plus-plus.org/

If you want Notepad++ to show every single word in the current document, you can select "Word completion". That might get annoying with large scripts, however.

To get the syntax highlight working, you will need to download my custom userDefineLang.xml then place it in your Notepad++ AppData folder (see below).

Now, type in %appdata%\Notepad++ in your Explorer (or in Run).
You should see a folder with a couple files (config.xml, contextMenu.xml, shortcuts.xml, stylers.xml).

NOTE: If you have a file called userDefineLang.xml that you want to keep, you will have to merge those files manually.

Copy the downloaded userDefineLang.xml to the folder you're in (it should look something like this).

After that, you need to associate Notepad++ with PAWN files, see below.
[Image: step-3.png]
Additionally, you can put .inc there if you want to.

Auto-complete
You will need an API file for the auto-completion.

Download PAWN.xml (right click -> save link/target) and put it in the "APIs" folder; this, however, is not located in your AppData. It's in the program's main folder.
[Image: step-a.png]

It should look somewhat like this:
[Image: step-b.png]

Ctrl + Space will pop up the auto-complete, and Ctrl + Shift + Space will show the function arguments.
You can, however, make this happen automatically by changing your settings, see below:
Click that and find this tab:
[Image: settings-2.png]
If you want to see the auto-complete instantly, put "From the 1 th character".

Compiling
For this to work, you will need a plugin called NppExec. If you already have it, skip this step.
If you don't have the Plugin Manager, download the latest copy of Notepad++.

Check NppExec and click Install; restart Notepad++ when prompted to.

[Image: step-6.png]
Put this code in the window that pops up:

Put npp_save on the first line if you want to save the file before compiling automatically (lazy motherfucker..).
Code:
cd $(CURRENT_DIRECTORY)
"C:\Program Files (x86)\PAWN Compiler\pawncc.exe" "$(FILE_NAME)" -; -(

NOTE: Replace the path to match your PAWN compiler folder; also make sure you have an "include" folder in there with the latest SA-MP include files.

[Image: step-7.png]
[Image: step-8.png]
Now it should try compiling whatever document you have open. If you see any output from the PAWN compiler, then it's looking good so far.

[Image: step-10.png]
Optionally, check this to slim down the output in the command window.


Now you will probably want to assign a hotkey to the compile script.

Open up the NppExec settings.
[Image: step-11.png]

Select "PAWN Compiler" from the list, click "Add/Modify", then click "OK".


Restart Notepad++.

Open up the shortcut mapper.


Find "PAWN Compiler" under "Plugin commands"; double click it.


Select a suitable key (combination) then click "OK" and click "Close" on the shortcut mapper.



Creating your own IRC Channel

Creating your own IRC Channel
Firstly when you connect to mIRC, Identify/ Log yourself in with the command:

/identify <password> (You need a registered nickname in order to register a channel)

If you are not registered you cant create own channel. To do it read /cs register help.

Think of a name of your channel and then type:

/join #yourchannelname.

Be sure to check if your name starts with @ after channel join (means the channel isn't taken/registered already).

Now, at your newly made channel, type:

/cs register [#channelname] [password] [short description], fill in all of them.

Now you're registered to your channel, first thing to check is if your owner, to check that just see if your name starts with ~    

If your name doesn't start with ~, meaning your still not owner,  type:

/cs identify [#channelname] [channelpassword]
then        
/cs owner

If you want a bot to auto-rank you type:

/bs botlist

Now, find a botname at your main status channel. Once you found one, type

/bs assign [#channelname] [Botname you have choosen] to assign the chosen bot to your channel.

Now that you have a bot, you might want to auto-rank them instead of setting them every time they join your channel.

The ranks:
VOP = +  (voice rights:  you'll still be able to talk when the channel is muted)
HOP = % (halfop rights: like a moderator, kicking and muting is in your power)
AOP = @ (op rights:      like an admin, banning and several other controls are at your disposal)
SOP = &  (higher admin: some more stuff you can do)

To set them, type:

/cs [rank] [#your channel name ] add [name of the user] - To set a specific rank type to user
/cs [rank] [#your channel name ] del [name of the user] - To remove a specific rank type of user
/cs help you'll find a list of help topics. - To perform more commands on players do

Other way of ranks:
+v = voiced
+h = halfop
+o = op
+a = higer admin/Sop
+q = channel owner (to set 2nd or 3th channel owner: set +a to user and later +q , can be +aq too)

Other way to set ranks:
/cs flags [#chanel] [user nickname] [+/-level] - Example: /cs flags #tocha123 Zyga +o
T
o remove level: /cs flags #tocha123 Zyga -o

After setting the rank to user he needs to re-join #channel or /identify again (to be sure that he got the rank permanent).


If you want to ban someone from your channel then these command:

To ban type:
/mode #channel +b nickname/hostname

To unban type:
/mode #channel -b nickname/hostname

If you want to kick someone from your channel then type:
/kick [#channel] [nickname] [reason]

And if you want to invite an user to your channel type:
/invite [nickname] [#channel]

IRC HostName

Hostname looks like an email address but it's the Computer's address on the Internet, banning the hostname is similar to range banning, so to check if you want to see the hostname type:

/whois nickname


To request own HostName use:
/hs request <text you want to have>

Now you have to wait like 24h (or some times longer) to get ur hostname request accepted or rejected (you will get an information about that fact)

Important:
* .bot, .admin marks are NOT allowed to use (request will be auto rejected)
* bad words are not tolerated
* your hostname text request may be rejected for any reason by irc.tl admins

Some more basic IRC commands

/HELP   shows general help or help on the given command.
/LIST   lists all current channels.
/JOIN   to join a channel
/PART   to leave a channel
/QUIT       exits your IRC session,
/NICK   changes your nickname
/AWAY   leaves a message saying you're away or not paying attention
/WHOIS   displays information about someone who is connected to irc
/WHOWAS displays information about someone who was connected to irc
/NS INFO [USER NAME] shows basic info's about irc user, example: when he registered, last seen on irc etc.
/INVITE   sends an invitation to another user
/TOPIC   changes the topic of the channel
* Shady           sends anything about you to a channel or QUERY


Setting Auto-voice for users (after join they will be auto-voiced) type:

/cs flags [#channel] *!*@* +V

To disable auto voice[b]: /cs flags [#channel] *!*@* -V

[b]Setting channel topic/text:


Of course, you would want to add a topic, to do this:
Double click any white part of your channel's field or you can just right click and choose Channel modes

This window would pop-up (if you use mIRC, on other clients it can looks different)

[Image: 20sug5f.jpg]

Add any text on Topic History

Some basics for you, if you want some coloured text or a coloured/ background text, Press CTRL + K  ,
Example: █11,1      First number is the Text colour, second is the background colours, if you don't want a background, simply go with █11

Color graph:

[Image: 20ib23q.jpg]

Some times the channel topic got removed if no one is on channel.
To keep ur topic permanent on (text can be changed always) use:
/cs set #channel KEEPTOPIC on

Some other functions like ctrl+B for bold text, ctrl+U to underline text

That should be it, and now you have your own channel ^^

PS: If you want to know how to add your own commands for your own Bot,  Google or watch some youtube videos on mIRC Scripting

]


How to make a simple anti-weapon-hack.

How to make a simple anti-weapon-hack.



Hello,this is my tutorial.

In this,i'll explain how to setup and code a small (but efficient) anti weapon hack in simple steps!

Please note that ALL the lines wrote here,are commented so you can except the maximum understand of the FULL code. 

This small anticheat doesn't use ANY timers or OnPlayerUpdate.

So,let's start.

First step is to add a custom stock in our gamemode:

Code:
stock ForbiddenWeap(playerid) // ForbiddenWeap will be called for our small anticheat.
{
    new weap = GetPlayerWeapon(playerid); // GetPlayerWeapon is to get the currently weapon of the player.
    if( weap == 36 || weap == 37 || weap == 38 || weap == 38 || weap == 41 || weap == 42 || weap == 43 || weap == 44 || weap == 45 || weap == 46) // This are the FORBIDDEN weapon (s) ID (s)
    {
     return true; // return true = A player has ONE or MORE of this weapons in hand.
    }
    return false; // else he's clean.
}

Simply uh?First step is done,let's move to the second and last step.

Move to OnPlayerKeyStateChange and paste this code. This callback is called when a player press FIRE or RELEASE button.

Code:
if(newkeys & KEY_FIRE && ForbiddenWeap(playerid)) // We define KEY_FIRE (used to shoot) to check if player has forbidden weap - ForbiddenWeap(playerid) is releated to the stock created earlier.
        {
            new weap, ammo; // Define currently holding weapon and ammo state.
            GetPlayerWeaponData(playerid, 7, weap, ammo); // Here we not define,the GetPlayerWeaponData will retrieve the info of the weapon (ammo and id).
            new pname[MAX_PLAYER_NAME]; // Create a new to store the player name.
            new string[170]; // Create a new string.
            GetPlayerName(playerid, pname, sizeof(pname)); // Here we get the player name with the "new pname" used above.
            format(string, sizeof(string), "AC: %s has been banned - Forbidden weapon (%s) with %d ammo.", pname,weap,ammo); // We format the string,we send the anticheat message with some values: Name of the player,weapon name and ammo.Ex: Test has been banned.Forbidden Weap: RPG with 90 ammo.
            SendClientMessageToAll(0xffffffff,string); // We send the string created at all online players.
            BanEx(playerid,string); // We ban the player.I used BanEx to insert the string in the ban file.
            return 1; // Return 1,player has been banned.
        }

And we're done 

Please remember this is a simple anticheat,with Pawn you can do things much complex than this.

How to create a trucking system

How to create a trucking system

Hello there, and welcome to my tutorial on how to create a simple trucking system. You need ZCMD for the commands.
This tutorial is pretty easy to catch on, skills required: 3/10.

The first thing we are going to create is a stock.
Stock IsATruck

Code:
stock IsATruck(vehicleid) {
    switch(GetVehicleModel(vehicleid)) { // makes it so it will greab the vehicle model
        case 499, 456: return 1; // If is model 499 or 456, return 1 (true)
        }
    return 0; // Else, false.
}

We'd want a little message when you are entering the truck that tells you to /loadtruck.
In order to do so, we need to check if the player is in state 3 (driver state) and IsATruck.
Go to OnPlayerStateChange and add this:

Code:
public OnPlayerStateChange(playerid, newstate, oldstate) {
if(newstate == 2) {
        if(IsATruck(GetPlayerVehicleID(playerid))) { // if you are in a truck
        SendClientMessage(playerid, COLOR_YELLOW, "You've entered an Ocean Dock truck. /loadtruck to load some goods."); // return this message.
        }
    }
    return 1;
}
Now we are going to create the command to load the truck.

Code:
CMD:loadtruck(playerid, params[]) {
    if(IsPlayerInRangeOfPoint(playerid, 5, 2197.8425,-2662.9883,13.5469)) { // Checks if you are close enough to the loading point.
    if(IsATruck(GetPlayerVehicleID(playerid))){ // Checks if you are inside a truck.
    LoadTruck(playerid); // calls the script to LoadTruck
    } else return SendClientMessage(playerid, COLOR_WHITE, "You are not in an Ocean Dock truck.");
    } else return SendClientMessage(playerid, COLOR_WHITE, "To load the truck, go to the loading garage in Ocean Docks, then /loadtruck.");
    return 1;
}
Great, now. You may see I added a LoadTruck function, and the command will not work without it so add this:

Code:
forward LoadTruck(playerid);
also add a:
Code:
new truckloaded = 0;
Code:
public LoadTruck(playerid) {
    new rand = random(sizeof(Destinations)); // defines the rand variable.
    SetPlayerCheckpoint(playerid, Destinations[rand][0], Destinations[rand][1], Destinations[rand][2], 3.0); // sets a checkpoint.
    SendClientMessage(playerid, COLOR_YELLOW, "Truck loaded - Go to the checkpoint to collect your payment.");
    truckloaded = 1;
return 1;
}

Still catching on? Great. We need to define the delivery points, so copy these cordinates and add them in the script.
Code:
new Float:Destinations[5][3] = {
   
    { 2401.7175,-1506.1350,23.5402 },
    { 1191.0847,-888.5489,42.7969 },
    { -69.6424,-1162.2354,1.5007 },
    { 334.1184,-1340.1366,14.2125 },
    { 481.7301,-1533.2468,19.6644 }
};
So, you need to get paid after delivering it, and in order to do so, go to OnPlayerEnterCheckpoint and add this:

Code:
        if(IsATruck(GetPlayerVehicleID(playerid))) {
            if(truckloaded == 1) {
        SendClientMessage(playerid, COLOR_COOLBLUE, "You've delivered the goods, and the company has paid you $250 for delivering them.");
        GivePlayerMoney(playerid, 250); // gives 250 dollars
        truckloaded = 0; // makes it so the truck is not loaded
        DisablePlayerCheckpoint(playerid);
                } else { DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_GREY, "You have apparently lost your truck, and the trucking route has been cancelled.");
                } else return 1;
                }
If I've missed anything or were unclear at any part, feel free to ask.



How to make simple Headshot system

How to make simple Headshot system

Hello Everybody i want to show you code for Headshot system

Lets startt!!!!

One shot to the head to kill with sniper rifle
Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        // One shot to the head to kill with sniper rifle
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
One Shot to the head to kill with all weapon
Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount)
{
    if(issuerid != INVALID_PLAYER_ID )
    {
        // One Shot to the head to kill with all weapon
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
Question?
What Is Bodyparts ??
What Is Weaponid ??

Answer!!!!
Bodyparts - http://wiki.sa-mp.com/wiki/Body_Parts
Weaponid - http://wiki.sa-mp.com/wiki/Weapons




How to make mask system for RP servers

How to make mask system for RP servers

Hello everybody, this is my tutorial, today i will make a tutorial about advanced Mask System.
This system include two commands, /maskon and /maskoff, when you are masked the players won't see your hp, armour and your name, this system used to RolePlay servers.



Setups:


First Setup:

you need zcmd.
Download zcmd.inc file and add to pawn/include after this go to pawno and inlucde the zcmd by, #include <zcmd> at top on pawno.


Second Setup:

First thing to avoid "undfined PlayerInfo" error you must do this:
Code:
enum pInfo
{
    pMaskOn,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Third Setup:
Doing the commands.
Code:
CMD:maskon(playerid, params[]) // this is the way you use since you are using zcmd include.
{
      if(PlayerInfo[playerid][pMaskOn] == 1) return SendPlayerMessage(playerid, -1, "You already masked."); // this checks of you are masked, if you are masked you won't be able to mask on agian.
      for(new i = 0; i < MAX_PLAYERS; i++) // here we telling the script what is "i"
        { // after this all command job will happen, before its is the things that won't able to the command to happen.
            ShowPlayerNameTagForPlayer(i, playerid, 0); // This code will hide your name when you type /maskon
        }
            SendPlayerMessage(playerid, -1, "You are masked now /mask off to remove it"); // this will send a message to the player that he is masked right now, this will happen when you type /maskon
            GameTextForPlayer(playerid,"~r~Mask On",1000,1); // this will send a text for player color red "Mask On" on screen
            PlayerInfo[playerid][pMaskOn] = 1; // this will tell the script that player is masked so he can't type /maskon again untill he /maskoff.
      return 1; // this used to return to the command, now you won't get any warn, if you don't return it will send "unknown command" in the game when you use the command, you must return after every command.
} // this must be added so we tell the script that the command is done.
Code:
CMD:maskoff(playerid, params[]) // this is the way you use since you are using zcmd include, as i explained  up
{
     if(PlayerInfo[playerid][pMaskOn] == 0) return SendPlayerMessage(playerid, -1, "You are not masked to remove the mask."); // [pMaskOn] == 0) means you aren't massked, [0 = no] [1 = yes], and you won't be able to use /maskoff if you aren't masked
     for(new i = 0; i < MAX_PLAYERS; i++)
         { // explanined it up
        ShowPlayerNameTagForPlayer(i, playerid, 1); // this will show your name, hp and armor.
               }
        SendPlayerMessage(playerid, -1 "You aren't masked now /mask on to wear it again"); // this will send a message to player that he is masked now.
        GameTextForPlayer(playerid,"~g~Mask off",1000,1); // this will send a message to the player on screen "mask off" color red
            PlayerInfo[playerid][pMaskOn] = 0; // this will tell the script that player isn't masked anymore so he can use /maskon again.
     return 1; // explanined it up
}

i hope i explained good, and i hope there is no any mistakes becuase i'm beginer scripter.


[-]
Share/Bookmark (Show All)
Face-bookTwitterMySpace
 
Copyright © 2014 Filetownz. Designed by OddThemes | Distributed By Gooyaabi Templates