SA-MP Forums Archive
[Tutorial] Scripting Basics for Stunt server - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Scripting Basics for Stunt server (/showthread.php?tid=485708)



[Tutorial] Scripting Basics for Stunt server - [SU]Spartan - 05.01.2014

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


Re: [Tutorial] Scripting Basics for Stunt server - jimis - 05.01.2014

Really helpful for newbies,reped


Re: [Tutorial] Scripting Basics for Stunt server - [SU]Spartan - 05.01.2014

Thanks you


Re: [Tutorial] Scripting Basics for Stunt server - Greek - 06.01.2014

Well a bit short but good.


Re: [Tutorial] Scripting Basics for Stunt server - Eth - 06.01.2014

wrong section.. but good one :P


Re: [Tutorial] Scripting Basics for Stunt server - Greek - 06.01.2014

hAHA Eth it is me [S4S]Giannis


Re: [Tutorial] Scripting Basics for Stunt server - [SU]Spartan - 06.01.2014

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


Re: [Tutorial] Scripting Basics for Stunt server - Wizzy951 - 06.01.2014

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.


Re: [Tutorial] Scripting Basics for Stunt server - [SU]Spartan - 06.01.2014

Fine -_-