19.05.2012, 16:20
Hello, this script compiles without errors, but doesnt work ingame?:
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <SAMSite>
#define COLOR_AQUA 0x00FFFFFF
//The Teams
#define TEAM_USA 0
#define TEAM_RUSSIA 1
#define TEAM_GERMANY 2
#define TEAM_BANGLADESH 3
#define TEAM_ITALY 4
#define TEAM_BRAZIL 5
#define TEAM_SERBIA 6
#define TEAM_FRANCE 7
//SAM Sites
#define US_SAM_1 0
#define US_SAM_2 1
#define US_SAM_3 2
#define US_SAM_4 3
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
AddPlayerClassEx(0, 287, 89.5718, 1921.1682, 17.9202, 102.1499, 25, 50, 31, 400, 39, 20);
AddPlayerClassEx(1, 166, 771.0197, 1873.7013, 8.0957, 266.5783, 18, 10, 30, 300, 34, 46);
AddPlayerClassEx(2, 254, -642.4337, 2715.4758, 72.3750, 133.9510, 22, 85, 32, 200, 31, 700);
AddPlayerClassEx(3, 120, -218.3907, 2645.5232, 63.1823, 178.6604, 24, 30, 30, 672, 33, 50);
AddPlayerClassEx(4, 217, 1343.8055, -895.4852, 36.4187, 263.2225, 27, 20, 31, 965, 38, 200);
AddPlayerClassEx(5, 239, 1421.5905, 2741.6765, 10.8203, 84.5192, 28, 40, 34, 90, 37, 120);
AddPlayerClassEx(6, 220, -2350.1025, -1610.2853, 483.6269, 249.1130, 28, 200, 34, 40, 39, 25);
AddPlayerClassEx(7, 123, -1505.2146, 2519.2820, 55.9182, 348.7282, 25, 50, 29, 400, 31, 300);
//SAM Sites
AddStaticSAM(237.5797,1698.6908,23.8673);
AddStaticSAM(15.3281,1720.9646,23.8673);
AddStaticSAM(188.2694,2083.4644,23.9063);
AddStaticSAM(354.5453,2030.3062,23.8750);
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");
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);
if(classid == 0)
{
GameTextForPlayer(playerid, "Team: ~b~USA", 6000, 6);
SetPlayerColor(playerid, 0x0000FFFF);
}
if(classid == 1)
{
GameTextForPlayer(playerid, "Team: ~r~Russia", 6000, 6);
SetPlayerColor(playerid, 0xFF0000FF);
}
if(classid == 2)
{
GameTextForPlayer(playerid, "Team: ~g~Germany", 6000, 6);
SetPlayerColor(playerid, 0x00FF00FF);
}
if(classid == 3)
{
GameTextForPlayer(playerid, "Team: Bangladesh", 6000, 6);
SetPlayerColor(playerid, 0xC0C0C0FF);
}
if(classid == 4)
{
GameTextForPlayer(playerid, "Team: Italy", 6000, 6);
SetPlayerColor(playerid, 0x408080FF);
}
if(classid == 5)
{
GameTextForPlayer(playerid, "Team: Brazil", 6000, 6);
SetPlayerColor(playerid, 0x808000FF);
}
if(classid == 6)
{
GameTextForPlayer(playerid, "Team: ~w~Serbia", 6000, 6);
SetPlayerColor(playerid, 0xFFFFFFFF);
}
if(classid == 7)
{
GameTextForPlayer(playerid, "Team: France", 6000, 6);
SetPlayerColor(playerid, 0xFF8040FF);
}
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
if(GetPlayerColor(playerid) == 0x0000FFFF) SetPlayerTeam(playerid, TEAM_USA);
if(GetPlayerColor(playerid) == 0xFF0000FF) SetPlayerTeam(playerid, TEAM_RUSSIA);
if(GetPlayerColor(playerid) == 0x00FF00FF) SetPlayerTeam(playerid, TEAM_GERMANY);
if(GetPlayerColor(playerid) == 0xC0C0C0FF) SetPlayerTeam(playerid, TEAM_BANGLADESH);
if(GetPlayerColor(playerid) == 0x408080FF) SetPlayerTeam(playerid, TEAM_ITALY);
if(GetPlayerColor(playerid) == 0x808000FF) SetPlayerTeam(playerid, TEAM_BRAZIL);
if(GetPlayerColor(playerid) == 0xFFFFFFFF) SetPlayerTeam(playerid, TEAM_SERBIA);
if(GetPlayerColor(playerid) == 0xFF8040FF) SetPlayerTeam(playerid, TEAM_FRANCE);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/myteam", cmdtext, true, 6) == 0)
{
SendClientMessage(playerid, 0xFF8040FF, "ERROR: Command is not active");
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public OnSamSiteUpdate(samid, playerid)
{
if(samid == US_SAM_1)
{
if(GetPlayerTeam(playerid, TEAM_USA))
{
return 0;
}
}
if(samid == US_SAM_2)
{
if(GetPlayerTeam(playerid, TEAM_USA))
{
return 0;
}
}
if(samid == US_SAM_3)
{
if(GetPlayerTeam(playerid, TEAM_USA))
{
return 0;
}
}
if(samid == US_SAM_4)
{
if(GetPlayerTeam(playerid, TEAM_USA))
{
return 0;
}
}
return 1;
}