Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
new pObject[MAX_PLAYERS] = {INVALID_OBJECT_ID, ...};
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
pObject[playerid] = INVALID_OBJECT_ID;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/campfire", cmdtext, true, 10) == 0)
{
new Float:x, Float:y, Float:z;
new Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
if(pObject[playerid] != INVALID_OBJECT_ID) return SendClientMessage(playerid, -1, "You already have an campfire!");
pObject[playerid] = CreateObject(841, x+5,y,12.5000000,0,0,a); // change the object id
pObject[playerid] = CreateObject(841, x+5,y,12.5000000,0,0,a); // change the object id
pObject[playerid] = CreateObject(841, x+5,y,12.5000000,0,0,a); // change the object id
pObject[playerid] = CreateObject(3461, x+5,y,11.0000000,0,0,a); // change the object id
pObject[playerid] = SendClientMessage(playerid, -1, "You made an campfire!");
return 1;
}
if (strcmp("/removecamp", cmdtext, true, 10) == 0)
{
DestroyObject(pObject[playerid]);
pObject[playerid] = INVALID_OBJECT_ID;
return 1;
}
return 0;
}