Could you give me an example I am a bit of a n00b when it comes to scripting thanks
|
public OnFilterScriptInit()
{
// Code number 1
}
public OnGameModeInit()
{
// Code number 2
}
public OnGameModeInit()
{
// Code number 1
// Code number 2
}
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
new kk;
public OnFilterScriptInit()
{
CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1) (1)
kk = CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1) (1)
// pos2 CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1)
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/open", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0x000000ff,"{ff0000}Welcome Back to your cave");
MoveObject(kk, -395.20001220703, 1242.6999511719, -1.3999999761581, 208, 0.30000001);
return 1;
}
if (strcmp("/close", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0x000000ff,"{ff0000}You are now leaving the cave");
MoveObject(kk, -395.20001220703, 1242.6999511719, 4.0999999046326, 208, 0.30000001);
return 1;
}
return 0;
}
#include <a_samp>
main()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
new kk;
public OnFilterScriptInit()
{
CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1) (1)
kk = CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1) (1)
// pos2 CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1)
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/open", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0x000000ff,"{ff0000}Welcome Back to your cave");
MoveObject(kk, -395.20001220703, 1242.6999511719, -1.3999999761581, 208, 0.30000001);
return 1;
}
if (strcmp("/close", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0x000000ff,"{ff0000}You are now leaving the cave");
MoveObject(kk, -395.20001220703, 1242.6999511719, 4.0999999046326, 208, 0.30000001);
return 1;
}