My first Script is a little mess up
#1

Can anyone run my gamemode and help me with my problem, when I enter the game it doesn't let me spawn at the other spawn points i set. I am just making my own to learn. I am not done i am just testing it

Quote:

#include <a_samp>
#include <zcmd>
#include <a_npc>
#include <a_players>

#define RECORDING "mynpc" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.

#define Police 0
#define Prisoners 1
#define Ghost 2
/////////////////////*/
/////////////////////*/
//Police Ranks///////*/
#define Cadet 3
#define Officer 4
#define Corporal 5
#define Sergeant 6
#define Lieutenant 7
#define Captain 8
#define Major 9
#define Chief 10
#define Commissioner 11
/////////////////////*/
/////////////////////*/
//Prisoners Ranks////*/
#define BadBoy 11
#define Bully 12
#define Theif 13
#define Bandit 14
#define Burgler 15
#define Robber 16
#define Hi-Jacker 17
#define Rapist 18
#define Kidnapper 19
#define MadMen 20
//End Of Ranks///////*/
#define Police_Blue 0x00FF00AA
#define Prisoners_Red 0xFF0000AA

#define Cyan 0x00FFFFFF
#define Green 0x0000FFAA
#define Red 0xAA3333AA
#define Orange 0xFF9900AA
#define Grey 0xAFAFAFAA
#define Yellow 0xFFFF00AA
#define Blue 0x0000BBAA
#define LightBlue 0x33CCFFAA

#define xxx SendClientMessage


new gPlayerTeam[MAX_PLAYERS];

main()
{
print("\n-----------------------------------------");
print(" Police Versus Prisoners by. Heroleo911003");
print("-----------------------------------------\n");
}

public OnGameModeInit()
{
/////////////////////////////////////////Police Vehicles/////////////////////////////////
AddStaticVehicleEx(560,1545.5916,-1647.4180,5.5962,271.8970,95,83,60); // police sultan
AddStaticVehicleEx(560,1545.3945,-1643.6583,5.6413,273.2833,95,83,60); // police sultan
AddStaticVehicleEx(574,1526.7526,-1655.8146,5.6204,269.5779,26,26,60); // police sweeper
AddStaticVehicleEx(574,1526.7117,-1652.3715,5.6048,268.2072,26,26,60); // police sweeper
AddStaticVehicleEx(574,1526.5276,-1642.8473,5.6086,179.8577,26,26,60); // police sweeper
AddStaticVehicleEx(574,1530.7529,-1642.8000,5.6131,179.1864,26,26,60); // police sweeper
AddStaticVehicleEx(523,1582.1523,-1673.4634,5.4612,238.0238,0,0,60); // police bike
AddStaticVehicleEx(523,1582.1683,-1671.1698,5.4618,239.8520,0,0,60); // police bike
AddStaticVehicleEx(523,1582.3525,-1669.1385,5.4555,246.2256,0,0,60); // police bike
AddStaticVehicleEx(523,1582.2137,-1666.9359,5.4535,245.8916,0,0,60); // police bike

///////////////////////////////////////Prisoners Vehicles////////////////////////////////
AddStaticVehicleEx(461,2471.1162,-1705.6359,13.1064,178.0507,37,1,60); // Prisoners PCJ
AddStaticVehicleEx(461,2471.2485,-1701.8091,13.1019,178.0390,37,1,60); // Prisoners PCJ
AddStaticVehicleEx(461,2471.4272,-1696.6033,13.1006,178.0355,37,1,60); // Prisoners PCJ
AddStaticVehicleEx(461,2471.5669,-1692.5345,13.0993,178.0349,37,1,60); // Prisoners PCJ
AddStaticVehicleEx(461,2475.2339,-1704.9199,13.1100,181.5231,37,1,60); // Prisoners PCJ
AddStaticVehicleEx(461,2475.1479,-1701.6310,13.1083,181.4839,37,1,60); // Prisoners PCJ
AddStaticVehicleEx(461,2475.0518,-1697.8560,13.1058,181.4250,37,1,60); // Prisoners PCJ
AddStaticVehicleEx(461,2474.9539,-1693.8556,13.1004,181.3612,37,1,60); // Prisoners PCJ
AddStaticVehicleEx(461,2474.8770,-1690.5458,13.0995,181.3507,37,1,60); // Prisoners PCJ
AddStaticVehicleEx(471,2518.9734,-1673.1125,13.8919,67.1756,103,111,60); // Prisoners Quad
AddStaticVehicleEx(474,2506.2566,-1693.8796,13.3184,1.0393,81,1,60); // Prisoners Garage Ride
AddStaticVehicleEx(475,2510.0671,-1686.9967,13.3638,48.3759,17,1,60); // The Red Sabre
AddStaticVehicleEx(481,2504.6565,-1657.1376,13.0782,235.0323,3,3,60); // BMX
AddStaticVehicleEx(481,2496.3977,-1653.1716,12.9380,273.6573,3,3,60); // BMX
AddStaticVehicleEx(481,2508.3384,-1662.9479,12.9355,198.0490,3,3,60); // BMX
AddStaticVehicleEx(481,2465.1108,-1672.5259,12.9967,6.3187,3,3,60); // BMX
AddStaticVehicleEx(481,2447.9731,-1642.4425,13.2506,275.5164,3,3,60); // BMX
AddStaticVehicleEx(482,2428.1917,-1678.6935,13.8693,92.5244,48,48,60); // Prisoners Van
AddStaticVehicleEx(482,2436.3186,-1678.4982,13.8712,91.1074,52,52,60); // Prisoners Van
AddStaticVehicleEx(486,2424.8826,-1636.6245,13.6609,178.0172,1,1,60); // Use it well
AddStaticVehicleEx(487,2528.8669,-1677.4467,20.1079,92.2370,54,29,60); // Prisoners Heli
/////////////////////////////////////////////////////////////////////////////////////////
///////////////////ACTORS////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
SetGameModeText("PVP");

return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{

ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, " Team Selection", "Police\nPrisoners\nGhost", "Choose", "Cancel");

xxx(playerid, 0xFFFFAAAA, " Welcome To Police Verus Prisoners, Commands: /help, /rules /cmds /admins /newb /report");
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof (name));
format(string, sizeof string, " %s Has join the server, WELCOME.", name);
SendClientMessageToAll( Green, string);
return 1;
}

public OnPlayerSpawn(playerid)
{
if(gPlayerTeam[playerid] == 0)
{
SetPlayerPos(playerid, 1580.5052,-1634.5775,13.5616);
xxx(playerid, Police_Blue, "You are a Police, as a Police you must make sure no prisoners escape and if they do go arrest them.");
xxx(playerid, Police_Blue, "If you need any help with your team simply use either /help or /tmcmds .");
}

if(gPlayerTeam[playerid] == 1)
{
SetPlayerPos(playerid, 2495.5320,-1688.2645,13.6977);
xxx(playerid, Prisoners_Red, " You are a Prisoner, as a Prisoner police are always out looking for you to keep you lock in jail, you either takedown those Police or run, and if they catch you simply escape.");
xxx(playerid, Prisoners_Red, "If you need any help with your team simply use either /help or /tmcmds .");
}

if(gPlayerTeam[playerid] == 2)
{
SetPlayerPos(playerid, 2650.3674,-2345.3611,17.3403);
}
return 1;
}

public OnPlayerDisconnect(playerid)
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof (name));
format(string, sizeof string, " %s Has left the server, GOODBYE.", name);
SendClientMessageToAll(Green, string);

return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(gPlayerTeam[killerid] == 0 && gPlayerTeam[playerid] == 2)
{
xxx(killerid, Cyan, " Nice Hunt, you have kill a Ghost. Heres your reward.");
GivePlayerMoney(killerid, 5000);
SetPlayerHealth(killerid, 100);
SetPlayerArmour(killerid, 100);
GivePlayerWeapon(killerid, 17, 999);
xxx(killerid, Cyan, " You Recieve Money, Health, Armor and a Weapon from your Ghost Hunt.");

xxx(playerid, Cyan, " You were hunted to death by a Police, Therefore you are no more");
GivePlayerMoney(playerid, -5000);
ForceClassSelection(playerid);

}

if(gPlayerTeam[killerid] == 1 && gPlayerTeam[playerid] == 2)
{
xxx(killerid, Cyan, " Nice Hunt, you have kill a Ghost. Heres your reward.");
GivePlayerMoney(killerid, 5000);
SetPlayerHealth(killerid, 100);
SetPlayerArmour(killerid, 100);
GivePlayerWeapon(killerid, 17, 999);
xxx(killerid, Cyan, " You Recieve Money, Health, Armor and a Weapon from your Ghost Hunt.");

xxx(playerid, Cyan, " You were hunted to death by a Prisoner, Therefore you are no more");
GivePlayerMoney(playerid, -5000);
ForceClassSelection(playerid);

}

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("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
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 OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(gPlayerTeam[playerid] == 0 && gPlayerTeam[hitid] == 0)
{
xxx(playerid, Police_Blue, " Team Attacking is not allowed, so your dead.");
xxx(hitid, Police_Blue, " You were Team Attacked, so heres 100% health.");
SetPlayerHealth(playerid, 0);
SetPlayerHealth(hitid, 100);
}
if(gPlayerTeam[playerid] == 1 && gPlayerTeam[hitid] == 1)
{
xxx(playerid, Prisoners_Red, " Team Attacking is not allowed, so your dead.");
xxx(hitid, Prisoners_Red, " You were Team Attacked, so heres 100% health.");
SetPlayerHealth(playerid, 0);
SetPlayerHealth(hitid, 100);
}
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[])
{
if(dialogid == 1)
{
if(response)
{
if(listitem == 0)
{
SetPlayerTeam(playerid, 0);
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "RANK SELECTION", " Cadet \n Officer \n Corporal \n Sergeant \n Lieutenant \n Captain \n Major \n Cheif \n Commissioner", "Select", "Back");
}

if(listitem == 1)
{
SetPlayerTeam(playerid, 1);
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "RANK SELECTION", " BadBoy \n Bully \n Thief \n Bandit \n Burglar \n Robber \n Rapist \n Kidnapper \n MadMen", "Select", "Back");
}

if(listitem == 2)
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, 2650.3674,-2345.3611,17.3403);
SetPlayerTeam(playerid, 2);
SetPlayerSkin(playerid, 29);
xxx(playerid, Grey, " You are a Ghost, you can't be seen on the map and everyone is your enemy.");
xxx(playerid, Grey, " Do Not let anyone kill you or they will recieve their reward"),
GivePlayerWeapon(playerid, 14, 1000); GivePlayerWeapon(playerid, 15, 1000); GivePlayerWeapon(playerid, 16, 10000); GivePlayerWeapon(playerid, 17, 10000);
SetPlayerColor(playerid, Grey);
}
}
}


if(dialogid == 2)
{
if(gPlayerTeam[playerid] == 0)
{
if(response)
{
if(listitem == 0)
{
SpawnPlayer(playerid);
SetPlayerSkin(playerid, 71); GivePlayerWeapon(playerid, 34, 10000); GivePlayerWeapon(playerid, 27, 10000);
SetPlayerColor(playerid, Police_Blue);
}
if(listitem == 1)
{
SpawnPlayer(playerid);
SetPlayerSkin(playerid, 280); GivePlayerWeapon(playerid, 20, 10000); GivePlayerWeapon(playerid, 21, 10000); GivePlayerWeapon(playerid, 22, 10000);
SetPlayerColor(playerid, Police_Blue);
SetPlayerArmour(playerid, 10);
}

}

}

}

if(dialogid == 3)
{
if(gPlayerTeam[playerid] == 1)
{
if(response)
{
if(listitem == 0)
{
SpawnPlayer(playerid);
SetPlayerSkin(playerid, 255);
SetPlayerColor(playerid, Prisoners_Red);
}
}
}
}
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

CMD:help(playerid, params[])
{
xxx(playerid, Grey, " Okay this is a PVP server where player versus Player/nInstead Police Versus Prisoners so technically you have your team which is police or prisoners.");
xxx(playerid, Grey, " All you have to do is kill the other team but you can also get away from the other team(that is if your a scared whiny baby.");
xxx(playerid, Grey, " I think you got it, so Play Fair, Play Safe. Give me a favor and use /rules");
return 1;
}

CMD:rules(playerid, params[])
{
xxx(playerid, Grey, "|<><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><>|");
xxx(playerid, Grey, "| Do not use any sort of hacks/cheats please.");
xxx(playerid, Grey, "|<><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><>|");
xxx(playerid, Grey, "| Do not share your password/data.");
xxx(playerid, Grey, "|<><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><>|");
xxx(playerid, Grey, "| Do not flood the chats and you must respect others.");
xxx(playerid, Grey, "|<><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><>|");
xxx(playerid, Grey, "| use the command /afk first before you pause, use /back when your back.");
xxx(playerid, Grey, "|<><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><>|");
xxx(playerid, Yellow, "| WARNING: [IF YOU TEAM ATTACK YOU WILL DIE] and your teammate will gain 100 health, Team Attack at your own risk.");
xxx(playerid, Grey, "|<><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><>|");
xxx(playerid, Grey, "| If you don't know the commands you can always use /cmds");
xxx(playerid, Grey, "|<><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><>|");
xxx(playerid, Blue, "| PLAY FAIR, PLAY SAFE.");
xxx(playerid, Grey, "|<><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><>|");
return 1;
}

CMD:cmds(playerid, params[])
{
xxx(playerid, Grey, " SERVER: /help, /rules, /cmds");
return 1;
}

CMD:acar(playerid)
{
if(IsPlayerAdmin(playerid))
{
new Float: x, Float: y, Float: z, Float: r, vehicle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, r);
vehicle = CreateVehicle(411, x, y, z, r, 0, 120, 300, 1);
PutPlayerInVehicle(playerid, vehicle, 0);
SetVehicleHealth(vehicle, 999999);
}
return 1;
}

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)