Code:
//Gamemode by kitten 10/14/10 2:30 AM
// So far some credits to playbox12 for making the Accent FS converted into this gamemode
#include <a_samp>
#include <streamer>
#include <a_npc>
//--TEAMS--//
new cTeam[MAX_PLAYERS];
#define TEAM_MEDIC 0
#define TEAM_SOLIDER 1
#define TEAM_POLICE 2
#define TEAM_SURVIVOR 3
#define TEAM_ZOMBIE 4
#define TEAM_ZOMBIE2 5
//--WEAPONS--//
#define AK47 30
#define M4 31
#define MP5 29
#define DEAGLE 24
#define GRENADE 16
#define TEC9 32
#define SHOTGUN 25
#define BASEBALL 5
#define KNIFE 4
//--COLORS--//
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
//--TEAM COLORS--//
#define TEAMMEDICSOLIDERPOLICESURVIVOR_COLOR 0x33CCFFAA
#define TEAM_COLORZOMBIE 0xFFFF00AA
//--Varaibles--//
new string[128];
//--Forwards--//
forward NearbyMessageForPlayers( playerid, stringcolour, text[]);
//--Dialogs--//
#define DialogIDChangeOnProblems 1928
main()
{
print("\n----------------------------------");
print(" San Fierro Apocalypse");
print("----------------------------------\n");
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("San Fierro Apocalypse");
AddPlayerClass(275, -2036.4352,179.3066,28.8429,266.0225,0,0,0,0,0,0); //MEDIC
AddPlayerClass(162, -1950.8861,696.2945,46.5625,355.4216,0,0,0,0,0,0);// ZOMBIE 1
AddPlayerClass(287, -1979.9567,138.0153,27.6875,91.8412,0,0,0,0,0,0);// SOLIDER
AddPlayerClass(137, -1950.8861,696.2945,46.5625,355.4216,0,0,0,0,0,0);// ZOMBIE 2
AddPlayerClass(280, -2019.7849,-46.1203,35.3375,270.1827,0,0,0,0,0,0);// POLICE
AddPlayerClass(2, -1978.7373,564.7525,38.6038,152.8846,0,0,0,0,0,0);// SURVIVOR
//--CARS--//
AddStaticVehicle(481,-2001.14855957,191.51016235,27.14783859,0.00000000,-1,-1); //BMX
AddStaticVehicle(481,-2000.90405273,193.13311768,27.14783859,0.00000000,-1,-1); //BMX
AddStaticVehicle(481,-2000.85705566,194.85237122,27.14783859,0.00000000,-1,-1); //BMX
AddStaticVehicle(481,-2000.51403809,196.48480225,27.14783859,0.00000000,-1,-1); //BMX
AddStaticVehicle(481,-2000.62243652,199.00923157,27.14016533,0.00000000,-1,-1); //BMX
AddStaticVehicle(481,-2030.83471680,171.84078979,28.44471359,273.99987793,-1,-1); //BMX
AddStaticVehicle(597,-2010.13940430,-57.55938721,35.03497696,0.00000000,-1,1); //Police Car (SFPD)
AddStaticVehicle(597,-2010.10949707,-51.39652634,35.03497696,0.00000000,-1,1); //Police Car (SFPD)
AddStaticVehicle(597,-2009.96496582,-45.44446564,35.04187393,0.00000000,-1,1); //Police Car (SFPD)
AddStaticVehicle(597,-2009.99194336,-38.89971161,35.02678299,0.00000000,-1,1); //Police Car (SFPD)
AddStaticVehicle(597,-2002.32812500,-21.70625877,34.88402939,0.00000000,-1,1); //Police Car (SFPD)
AddStaticVehicle(597,-2002.52661133,-33.21662140,34.97959518,0.00000000,-1,1); //Police Car (SFPD)
AddStaticVehicle(597,-2002.73022461,-40.48923111,35.03497696,0.00000000,-1,1); //Police Car (SFPD)
AddStaticVehicle(533,-2009.73657227,154.29324341,27.33906174,0.00000000,-1,-1); //Feltzer
AddStaticVehicle(533,-2010.02624512,160.68347168,27.33906174,0.00000000,-1,-1); //Feltzer
AddStaticVehicle(533,-2010.00012207,167.99829102,27.33906174,0.00000000,-1,-1); //Feltzer
AddStaticVehicle(533,-2010.03308105,175.05853271,27.33906174,0.00000000,-1,-1); //Feltzer
AddStaticVehicle(533,-2010.43811035,181.43998718,27.33906174,0.00000000,-1,-1); //Feltzer
AddStaticVehicle(466,-1997.47583008,710.11846924,45.21687317,180.00000000,-1,-1); //Glendale
AddStaticVehicle(466,-1997.29504395,703.10711670,45.21687317,180.00000000,-1,-1); //Glendale
AddStaticVehicle(466,-1997.55139160,695.92315674,45.21687317,180.00000000,-1,-1); //Glendale
AddStaticVehicle(466,-1997.60876465,717.14312744,45.21687317,180.00000000,-1,-1); //Glendale
AddStaticVehicle(489,-1978.91589355,555.88452148,35.57931137,90.00000000,-1,-1); //Rancher
AddStaticVehicle(489,-1979.34326172,552.20745850,35.56148148,90.00000000,-1,-1); //Rancher
AddStaticVehicle(489,-1979.63903809,548.88006592,35.56408310,90.00000000,-1,-1); //Rancher
AddStaticVehicle(579,-1979.79711914,543.48034668,35.31917191,90.00000000,-1,-1); //Huntley
AddStaticVehicle(579,-1979.66760254,540.60186768,35.30284119,90.00000000,-1,-1); //Huntley
AddStaticVehicle(579,-1979.66699219,540.60156250,35.30284119,90.00000000,-1,-1); //Huntley
AddStaticVehicle(579,-1979.76330566,537.61016846,35.30368423,90.00000000,-1,-1); //Huntley
AddStaticVehicle(445,-1997.63684082,533.79815674,35.00562668,0.00000000,-1,-1); //Admiral
AddStaticVehicle(445,-1996.67724609,527.94769287,35.00562668,0.00000000,-1,-1); //Admiral
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, -1959.4025,700.4174,46.5625);
SetPlayerCameraPos(playerid, -1958.2029,711.0995,53.6375);
SetPlayerCameraLookAt(playerid, -1959.4025,700.4174,46.5625);
SetPlayerFacingAngle(playerid,357.4232);
if(classid == 0)
{
GameTextForPlayer(playerid,"~b~ Human- Medic~w~Objective:Survive the apocalypse",1000,4);
cTeam[playerid] = TEAM_MEDIC;
}
else if(classid == 1)
{
GameTextForPlayer(playerid,"~r~ Zombie ~w~Objective: Eat brains",1000,4);
cTeam[playerid] = TEAM_ZOMBIE;
}
else if(classid == 2)
{
GameTextForPlayer(playerid,"~b~ Human- Solider ~w~Objective:Survive the apocalypse",1000,4);
cTeam[playerid] = TEAM_SOLIDER;
}
else if(classid == 3)
{
GameTextForPlayer(playerid,"~r~ Zombie 2 ~w~Objective: Eat brains",1000,4);
cTeam[playerid] = TEAM_ZOMBIE2;
}
else if(classid == 4)
{
GameTextForPlayer(playerid,"~b~ Human- Police ~w~Objective:Survive the apocalypse",1000,4);
cTeam[playerid] = TEAM_POLICE;
}
else if(classid == 5)
{
GameTextForPlayer(playerid,"~b~ Human- Survivor ~w~Objective:Survive the apocalypse",1000,4);
cTeam[playerid] = TEAM_SURVIVOR;
}
return 1;
}
public OnPlayerConnect(playerid)
{
SetPVarString(playerid,"Language","American");
//--Weapon Skills--//
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 0);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 0);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 0);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 0);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 0);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 0);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 0);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 0);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 0);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 0);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 0);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
if(cTeam[playerid] == TEAM_MEDIC)
{
GivePlayerWeapon(playerid,M4,500);
GivePlayerWeapon(playerid,SHOTGUN,10);
GivePlayerWeapon(playerid,DEAGLE,50);
SetPlayerTeam(playerid,TEAM_MEDIC);
SetPlayerColor(playerid,TEAMMEDICSOLIDERPOLICESURVIVOR_COLOR);
SendClientMessage(playerid,COLOR_WHITE,"SERVER: You are a MEDIC you can heal others or heal your self by typing /heal or /healhim id");
}
else if(cTeam[playerid] == TEAM_SOLIDER)
{
GivePlayerWeapon(playerid,AK47,500);
GivePlayerWeapon(playerid,MP5,1000);
GivePlayerWeapon(playerid,DEAGLE,50);
SetPlayerTeam(playerid,TEAM_SOLIDER);
SetPlayerColor(playerid,TEAMMEDICSOLIDERPOLICESURVIVOR_COLOR);
}
else if(cTeam[playerid] == TEAM_POLICE)
{
GivePlayerWeapon(playerid,M4,500);
GivePlayerWeapon(playerid,TEC9,1000);
GivePlayerWeapon(playerid,GRENADE,50);
SetPlayerTeam(playerid,TEAM_POLICE);
SetPlayerColor(playerid,TEAMMEDICSOLIDERPOLICESURVIVOR_COLOR);
}
else if(cTeam[playerid] == TEAM_SURVIVOR)
{
GivePlayerWeapon(playerid,AK47,500);
GivePlayerWeapon(playerid,MP5,1000);
GivePlayerWeapon(playerid,BASEBALL,50);
SetPlayerTeam(playerid,TEAM_SURVIVOR);
SetPlayerColor(playerid,TEAMMEDICSOLIDERPOLICESURVIVOR_COLOR);
}
else if(cTeam[playerid] == TEAM_ZOMBIE)
{
GivePlayerWeapon(playerid,KNIFE,1000);
SetPlayerTeam(playerid,TEAM_ZOMBIE);
SetPlayerColor(playerid,TEAM_COLORZOMBIE);
}
else if(cTeam[playerid] == TEAM_ZOMBIE2)
{
GivePlayerWeapon(playerid,KNIFE,1000);
SetPlayerTeam(playerid,TEAM_ZOMBIE);
SetPlayerColor(playerid,TEAM_COLORZOMBIE);
}
return 1;
}
public OnPlayerText(playerid, text[])
{
new playername[MAX_PLAYER_NAME], PlayersLanguage[12];
GetPlayerName(playerid, playername, sizeof(playername));
GetPVarString(playerid, "Language", PlayersLanguage, 12);
format(string, sizeof(string), "[%s Language] %s: %s", PlayersLanguage, playername, text);
NearbyMessageForPlayers(playerid, 0xFFFFFFAA, string);
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/heal", cmdtext, true, 10) == 0)
if(cTeam[playerid] == TEAM_MEDIC)
{
SetPlayerHealth(playerid,100);
SendClientMessageToAll(COLOR_LIGHTBLUE,"MEDIC: Has healed him self");
return 1;
}
if(strcmp("/class", cmdtext, true, 10) == 0)
{
ForceClassSelection(playerid);
return 1;
}
if(strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid,0);
return 1;
}
if (strcmp("/lang", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, DialogIDChangeOnProblems, DIALOG_STYLE_LIST, "Language selection", "American\nRussian\nBritish\nItalian\nDutch\nFrance\nAustralian\nAfrican\nChinese", "Select", "Quit");
return 1;
}
if(strcmp("/cmds", cmdtext, true, 10) == 0)
{if(cTeam[playerid] == TEAM_MEDIC)
SendClientMessage(playerid,COLOR_RED,"-----COMMANDS-----");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"MEDIC: /heal /healhim");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"------------------");
}
else if (cTeam[playerid] == TEAM_SOLDIER)
SendClientMessage(playerid,COLOR_RED,"-----COMMANDS-----");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"SOLIDER: Coming soon");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"------------------");
}
else if (cTeam[playerid] == TEAM_POLICE)
SendClientMessage(playerid,COLOR_RED,"-----COMMANDS-----");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"POLICE: Coming soon");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"------------------");
}
else if (cTeam[playerid] == TEAM_SURVIVOR)
SendClientMessage(playerid,COLOR_RED,"-----COMMANDS-----");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"SURVIVOR: Coming soon")
SendClientMessage(playerid,COLOR_LIGHTBLUE,"------------------");
}
else if (cTeam[playerid] == TEAM_SURVIVOR)
SendClientMessage(playerid,COLOR_RED,"-----COMMANDS-----");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"ZOMBIE: Coming soon");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"------------------");
return 1;
}
if(strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_RED,"-----HELP-----");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome to San Fierro Zombie Apocalypse");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"This is a server with fully self scripted by kitten");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"What do you do in this server / gamemode");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"There are 5 teams");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Medic,Solider,Police,Survivor,Zombie");
SendClientMessage(playerid,COLOR_LIGHTBLUE," For Objectives for each team please goto /obj");
return 1;
}
if(strcmp("/obj", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_RED,"-----TEAM OBJECTIVES-----");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Medic: Heal others survive the apocalypse");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"SOLIDER: Keep the survivors, police , medics alive");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Police: Do not let any civilian DIE and survive the apocalypse");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Survivor: Survive the apocalypse");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Zombie: Eat human brains by knifing them");
return 1;
}
new
index,
cmd[20];
cmd = strtok(cmdtext, index);
if (strcmp(cmd, "/healhim", true) == 0)
if(cTeam[playerid] == TEAM_MEDIC)
{
new
tmp[20],
id;
tmp = strtok(cmdtext, index);
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SetPlayerHealth(id, 100.0);
SendClientMessage(id, 0x00FF00AA, "You have been healed by medic survivor");
SendClientMessage(playerid, 0x00FF00AA, "you have healed the survivor");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
}
return 1;
}
return 0;
}
public NearbyMessageForPlayers( playerid, stringcolour, text[])
{
new Float:PosX, Float:PosY, Float:PosZ;
for(new p = 0; p < MAX_PLAYERS; p++)
{
if(IsPlayerConnected( p ))
{
GetPlayerPos( playerid, PosX, PosY, PosZ );
if(IsPlayerInRangeOfPoint(p, 12, PosX, PosY, PosZ) )
{
if(GetPlayerInterior( playerid ) == GetPlayerInterior( p ) && GetPlayerVirtualWorld( playerid ) == GetPlayerVirtualWorld( p ) )
{
SendClientMessage(p, stringcolour, text);
}
}
}
}
return 1;
}
//--Stuff not using only codes--//
strtok(const string2[], &index)
{
new length = strlen(string2);
while ((index < length) && (string2[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string2[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string2[index];
index++;
}
result[index - offset] = EOS;
return result;
}
I want to create a San Fierro Zombie RolePlay server and I want to edit this. PS: I am a beginner scripter.