[Tutorial] Scripting Basics for Stunt server
#1

Hello,
I've decided to make this topic to help scripting newbies with stunt server.

Adding MAPS from MTA: Open file computer then go to HARD DISK C: then open program files and search for MTA San Andreas ,when you find this file double click to open it.Then open MODS file then deathmach and then resources search for the map you want,open it and click on .MAP file.
On easy steps:My computer>> HARD DISK (C >> program files >> MTA San Andreas >> MODS >> Deathmatch >> resources >> [MAP NAME] >> .MAP File>> Copy .MAP file

Converting the objects from MTA to SA-MP: For this visit convertffs.com then paste the .MAP File on "PASTE HERE" and change the configuration below.If your using streamer include add
Код:
#include <streamer>
on the top

Convertffs.com configuration picture:

Placing the converted file on PAWNO:

Making /clockon and /clockoff: for STRCMP users:
Код:
	if (strcmp("/clockoff", cmdtext, true) == 0)
{
  	SendClientMessage(playerid, 0x4EDED7FF, "You have set your clock OFF!");
 	TogglePlayerClock(playerid, 0);
 	return 1;
}
for ZCMD users:
Код:
CMD:clockoff
{
  	SendClientMessage(playerid, 0x4EDED7FF, "You have set your clock OFF!");
 	TogglePlayerClock(playerid, 0);
 	return 1;
}
Making /teleports with CLIENT MESSAGE
Код:
	if (strcmp("/teles", cmdtext, true, 10) == 0)
 {
		SendClientMessage(playerid , 0xFFFFFFAA,"____________________-----------------______________");
		SendClientMessage(playerid , 0x2641FEAA,"Server teleports");
		SendClientMessage(playerid , 0x2641FEAA,"/sfair /lvair /lsair /ls /lv /sf /christmas /light_place /basketcar");
		SendClientMessage(playerid , 0x2641FEAA,"/treehouse /27marketls /casino /lsheavynlybar /home /tune1 /tune2 /tune3 /tune4 /tune soon /drift to come");
 		SendClientMessage(playerid , 0xFFFFFFAA,"____________________-------------__________________");
return 1;
 }
Making /teleports with DIALOGBecause it is too big you can find my filterscript here:[/b] [FilterScript]Teleport to all places
Animation listAnimation list is also too big so look my filterscript and get an idea[/b]Animation script by [SU]Spartan

Making /kill command
Код:
    if(!strcmp("/kill", cmdtext, true))
    {
        SetPlayerHealth(playerid, 0);
    	SendClientMessage(playerid, 0xFFFFFFAA, "You have commited suicidie");
        return 1;	
}
Making /god command
Код:
    if(!strcmp("/god", cmdtext, true))
    {
        SetPlayerHealth(playerid, 100000000.0);
    	SendClientMessage(playerid, 0xFFFFFFAA, "You have enabled god mode on you.");
	}
How to use SetPlayerPosTo use this you will need to have saved a position in game with /save <save name>
After you saved a positon go to MY Files and search SAVEDPOSITIONS.TXT then click on a line and select somenumbers because this is quite hard i have choosen to show you with pictures: Dont forget SetPlayerPos usage is SetPlayerPos(playerid, location);

Now making /fixmycar command
Код:
	if (!strcmp("/fixmycar", cmdtext))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
        return 1;	
}
About OnPlayerEnterVehicle This is used for when a player enters in a car either as passanger or driver,Then if you want to send him a client message which will help him with car system look below
Well the usage is
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	SendClientMessage(playerid,0x0000BBAA,"Use /fixmycar to fix your car");
	return 1;
}
About public OnPlayerExitVehicleThis is used for when a player exits a car,if you want to inform him that he left his car use the below
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
	SendClientMessage(playerid,0x0000BBAA,"You left your car");
	return 1;
}
If you want to tell him that his car will be removed use the below
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
	SendClientMessage(playerid,0x0000BBAA,"------------=[VEHICLE EXIT HELP]=----------------");
	SendClientMessage(playerid,0x0000BBAA,"Ur car has been removed Use /car to spawn another car");
	SendClientMessage(playerid,0x0000BBAA,"------------=[VEHICLE EXIT HELP END]=------------");
        new currentveh;
        currentveh = GetPlayerVehicleID(playerid);
        DestroyVehicle(currentveh);
	return 1;
}

Using AllowPlayerTeleportThis will allow a player to go at map and right click on a place and teleport him to there
Go on playerconnect and write this
Код:
public OnPlayerConnect(playerid)
{
        AllowPlayerTeleport( playerid, 1 );
	return 1;
}
Then go at the bottom and add this
Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    SetPlayerPosFindZ(playerid, fX, fY, fZ);
    return 1;
}
This is all for now thanks you for viewing my help topic

I would suggest you to use Scripting Machine instead of pawn.You can see all Scripting editors here: https://sampwiki.blast.hk/wiki/Scripting_Editors
Reply
#2

Really helpful for newbies,reped
Reply
#3

Thanks you
Reply
#4

Well a bit short but good.
Reply
#5

wrong section.. but good one :P
Reply
#6

hAHA Eth it is me [S4S]Giannis
Reply
#7

Erm gtfmt=get out from my topic,there are PMs for a reason.
Reply
#8

Quote:
Originally Posted by [SU]Spartan
Посмотреть сообщение
Erm gtfmt=get out from my topic,there are PMs for a reason.
You're wrong, there is report at similar circumstances - he had to report you and the moderators would move the thread.
Reply
#9

Fine -_-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)