03.06.2012, 16:22
WARNING:This threat is for beginners who need help,not for advanced ones.
This is my first tutorial,that's the reason it may be really bad.
Things I'll be showing:
1. What is PAWNO
2. What is Gamemode
3. How to make a Gamemode
4. What is Filterscript
5. What is ZCMD
6. How to use ZCMD
7. How to make a simple Dialog
8. How to make a response for the dialog
9. How to create objects
10. How to create vehicles
1PAWNO is a program with which you script for your server. It can be a gamemode,or filterscript.
2.Game mode is a file which you have to write in server.cfg so your server can run.
3.First,you open "pawno.exe" and click new. You will see how it is filled with many things: OnGameModeInit,OnGameModeExit,OnPlayerText,OnPlaye rCommandText,OnPlayerConnect,OnPlayerDissconnect,O nPlayerRequestClass. These are all blank codes. You need to fill them with what you wish to happen in order to make your gamemode full.
4.Filterscript is a small file,again .pwn and .amx,but it is something which you add in filterscripts and server.cfg. When done with both,when connecting to your server you'll see changes-things added from it. The Filterscript is a way to add something you scripted which you don't want in your gamemode.
5ZCMD is a include you need to add in your "include" and than do a #include <ZCMD> below your #include <a_samp> to start reading it. It is the most easiest way to create commands. Here is the link to download it: CLICK
When you finish downloading it,go to your server's directory, PAWNO,Includes,place it there.
6. Using ZCMD is really easy. For an example,you do like this:
Here is one of my commands:
So,let me explain more.
7. Creating a dialog is made by a command,let me show you an expample:
Let me explane how it goes now.
8 Making a dialog responce goes by this way.
9 Creating objects,let me give you an example.
Let me explain now.
10 Creating vehicles,let me give you an example.
The same goes for it with the model and Float:X,Y and Z,no rotations and colors at the end.
This is my first tutorial,that's the reason it may be really bad.
Things I'll be showing:
1. What is PAWNO
2. What is Gamemode
3. How to make a Gamemode
4. What is Filterscript
5. What is ZCMD
6. How to use ZCMD
7. How to make a simple Dialog
8. How to make a response for the dialog
9. How to create objects
10. How to create vehicles
1PAWNO is a program with which you script for your server. It can be a gamemode,or filterscript.
2.Game mode is a file which you have to write in server.cfg so your server can run.
3.First,you open "pawno.exe" and click new. You will see how it is filled with many things: OnGameModeInit,OnGameModeExit,OnPlayerText,OnPlaye rCommandText,OnPlayerConnect,OnPlayerDissconnect,O nPlayerRequestClass. These are all blank codes. You need to fill them with what you wish to happen in order to make your gamemode full.
4.Filterscript is a small file,again .pwn and .amx,but it is something which you add in filterscripts and server.cfg. When done with both,when connecting to your server you'll see changes-things added from it. The Filterscript is a way to add something you scripted which you don't want in your gamemode.
5ZCMD is a include you need to add in your "include" and than do a #include <ZCMD> below your #include <a_samp> to start reading it. It is the most easiest way to create commands. Here is the link to download it: CLICK
When you finish downloading it,go to your server's directory, PAWNO,Includes,place it there.
6. Using ZCMD is really easy. For an example,you do like this:
pawn Code:
CMD:[command](playerid,params[])
{
//Type what you wish your command to do here.
return 1;
}
pawn Code:
CMD:help(playerid,params[])
{
SendClientMessage(playerid,COLOR_WHITE,"Instant Weapons:/mp5");
SendClientMessage(playerid,COLOR_WHITE,"Store Commands:/drink /buygun /loan");
SendClientMessage(playerid,COLOR_WHITE,"Drinkable Items:/beer /whiskey /vodka /water");
SendClientMessage(playerid,COLOR_WHITE,"Common Commands:/respawn");
return 1;
}
pawn Code:
CMD:help(playerid,params[]) // This is your command CMD:help is when you create /help
{ //The thing which gives a start to the things that'll happen from the command.
SendClientMessage(playerid,COLOR_WHITE,"Instant Weapons:/mp5"); //The player which typed the command gets this message.
SendClientMessage(playerid,COLOR_WHITE,"Store Commands:/drink /buygun /loan");//The player which typed the command gets this message.
SendClientMessage(playerid,COLOR_WHITE,"Drinkable Items:/beer /whiskey /vodka /water");//The player which typed the command gets this message.
SendClientMessage(playerid,COLOR_WHITE,"Common Commands:/respawn");//The player which typed the command gets this message.
return 1; //The command's functions end by typing return 1;
} //The code is fully ended.
pawn Code:
CMD:help(playerid,params[])
{
ShowPlayerDialog(playerid,0,DIALOG_STYLE_LIST,"Help Menu","Account\nCommands\Admin\Helper\Shops\Houses","Enter","Exit");
return 1;
}
pawn Code:
CMD:help(playerid,params[]) //The command
{ //The code starts
ShowPlayerDialog //The first thing to type when coding a dialog
playerid // The ID of the player who used the command
"Help Menu" //The name of the dialog box
DIALOG_STYLE_LIST //The style of the dialog Note that the styles can be LIST,PASSWORD,MSG
"Account\nCommands\Admin\Helper\Shops\Houses" //What to show in the box
"Enter" //The first button on left
"Exit" //The second button on right
return 1; //The function ends
} //The code is finished
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid) // Lookup the dialogid
{
case 1:
{
if(!response)
{
SendClientMessage(playerid, 0xFF0000FF, "//What happens when you click the right button.");
return 1; // We processed it
}
switch(listitem) // This is far more efficient than using an if-elseif-else structure
{
case 0: // Listitems start with 0, not 1
{
// What should happen when they click on the first item?
}
case 1:
{
// And the second item?
}
case 2:
{
// We can keep going on here
}
// Add the rest of your listitems for dialog 1 here
}
}
// Add the rest of your dialogs here
}
return 0; // If you put return 1 here the callback will not continue to be called in other scripts
}
pawn Code:
public OnGameModeInit()
{
CreateObject(14881,1468.40002441,-677.00000000,75.30000305,0.00000000,0.00000000,0.00000000);
return 1;
}
pawn Code:
CreateObject //Starts the code-tells that it creates the object
14881 //Model ID
1468.40002441 //Float:X
-677.00000000 //Float:Y
75.30000305 //Float:Z
0.00000000 //Rotation:X
0.00000000 //Rotation:Y
0.00000000 //Rotation:Z
pawn Code:
AddStaticVehicleEx(497,990.70001221,1037.50000000,48.40000153,288.00000000,-1,-1,15); //Police Maverick