18.03.2011, 22:19
WTF i made this gamemode:
and the copiler crashes!!! WHAT TO DO??
pawn Код:
//includes
#include <a_samp>
#include "../include/gl_common.inc"
//defines
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_RED 0xFF0000AA
#define COLOR_GREEN 0x00FF00AA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_GRAY 0xAFAFAFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_LIGHTBLUE 0x0AFFFFAA
#define COLOR_PURPLE 0xFF00FFAA
#define COLOR_ORANGE 0xFFBB00AA
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new RandomMSG[][] =
{
"Random Message 1",
"Random Message 2",
"Random Message 3"
};
//forwards
forward gmx();
forward SendMSG();
main()
{
print("Running Chedders FreeRoam");
return 1;
}
public OnGameModeInit()
{
//GM Text
SetGameModeText("FreeRoam");
//classes
AddPlayerClass(1,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(2,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(23,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(28,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(33,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(50,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(60,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(61,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(62,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(67,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(70,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(71,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(79,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(98,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(100,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(101,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(102,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(103,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(104,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(105,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(106,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(107,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(108,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(109,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(110,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(115,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(116,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(117,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(118,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(120,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(121,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(137,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(156,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(163,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(164,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(165,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(166,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(170,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(171,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(179,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(180,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(181,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(186,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(188,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(189,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(200,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(206,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(217,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(223,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(227,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(228,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(240,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(247,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(248,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(250,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(254,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(255,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(260,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(265,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(266,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(267,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(268,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(269,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(270,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(271,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(272,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(274,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(277,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(280,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(285,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(286,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(287,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(288,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(290,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(291,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(292,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(293,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(294,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(295,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(296,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(297,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(298,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
AddPlayerClass(299,1962.4854,1342.7826,15.4823,89.1425,0,0,0,0,0,0); //
//vehicles
new total_vehicles_from_files = 0;
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt");
total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");
printf("Total vehicles from files: %d",total_vehicles_from_files);
//timers
SetTimer("gmx", 600000, true);
SetTimer("SendMSG", 60000, true);
//other
ShowNameTags(true);
SetNameTagDrawDistance(40.0);
EnableStuntBonusForAll(true);
}
public OnPlayerRequestClass(playerid, classid)
{
PlayerPlaySound(playerid,1185,0,0,0);
SetPlayerPos(playerid, 1958.3783, 1343.1115, 15.3746);
SetPlayerCameraPos(playerid, 1953.2152, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1962.4974, 1342.7480, 15.4823);
PlayerPlaySound(playerid,1185,0,0,0);
return 1;
}
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has joined the server.",name);
SendClientMessageToAll(0xFFFF00AA, string);
UsePlayerPedAnims();
new pname[24], File:ftw=fopen("names.txt", io_append);
GetPlayerName(playerid, pname, 24);
new string2[30];
format(string2, 30, "%s\r\n", pname); // formatting the string with the escape codes
fwrite(ftw, string2);
fclose(ftw);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
}
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
public OnPlayerSpawn(playerid)
{
PlayerPlaySound(playerid,1077,0,0,0);
SetPlayerWantedLevel(playerid, 6);
GivePlayerWeapon(playerid, 24, 999999);
GivePlayerWeapon(playerid, 27, 999999);
GivePlayerWeapon(playerid, 29, 999999);
GivePlayerWeapon(playerid, 31, 999999);
GivePlayerWeapon(playerid, 39, 999999);
GivePlayerWeapon(playerid, 45, 999999);
GivePlayerWeapon(playerid, 1, 1);
SetPlayerAttachedObject(playerid,1 , 356, 1,0,-0.18,0,0,30,0);
SetPlayerAttachedObject(playerid,2 , 355, 1,0,-0.14,-0.1,0,-30,0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
GivePlayerMoney(playerid, -10);
GivePlayerMoney(killerid, 100);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
return 1;
}
return 0;
}
public OnPlayerUpdate(playerid)
{
// No weapons in interiors
if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
SetPlayerArmedWeapon(playerid,0); // fists
return 0; // no syncing until they change their weapon
}
//No jetpacks allowed
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) {
Kick(playerid);
return 0;
}
// Don't allow minigun
if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN) {
Kick(playerid);
return 0;
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate==PLAYER_STATE_PASSENGER)
{
if(GetPlayerWeapon(playerid) == 24 )
{
SetPlayerArmedWeapon(playerid, 0);
SendClientMessage(playerid, COLOR_RED, "DONT DDB!!!");
}
}
return 1;
}
public gmx()
{
SendRconCommand("gmx");
return 1;
}
public SendMSG()]
{
new randMSG = random(sizeof(RandomMSG)); //calculates the size of RandomMSG (which is 3)
SendClientMessageToAll(COLOR, RandomMSG[randMSG]); // Replace the "color" with your defined color.
}