PDA

View Full Version : Help?


N0FeaR
06/06/2012, 09:55 PM
Can you see the problem in this cmd?


}
COMMAND:hduty(playerid, params[])
{
if(PlayerInfo[playerid][pHelper] >= 1)
{
if(HelperDuty[playerid] == 1)
{
format(string, sizeof(string), "[Helper] %s (ID:%d) is now an off duty Helper", GetPlayerNameEx(playerid),playerid);
HelperMessage(COLOR_TESTERDUTY,string);
SetPlayerColor(playerid,COLOR_WHITE);
HelperDuty[playerid] = 0;

if(CopOnDuty[playerid] == 1)
{
SetPlayerArmour(playerid,100);
SetPlayerColor(playerid,0x8c8cfeff);
}
else if(MedicOnDuty[playerid] == 1)
{
SetPlayerColor(playerid,0xfe8281ff);
}
else
{
SetPlayerColor(playerid,COLOR_WHITE);
}
}
else
{
format(string, sizeof(string), "[Helper] %s (ID:%d) is now an on duty Helper", GetPlayerNameEx(playerid),playerid);
HelperMessage(COLOR_TESTERDUTY,string);
HelperDuty[playerid] = 1;
SetPlayerColor(playerid,COLOR_TESTERDUTY);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
}
return 1;

milanosie
06/06/2012, 09:56 PM
What is the problem.

N0FeaR
06/06/2012, 09:58 PM
What is the problem.

The cmds wonts work..

milanosie
06/06/2012, 10:05 PM
Where's the final bracket?

tiernantheman
06/06/2012, 10:11 PM
COMMAND:hduty(playerid, params[])
{
if(PlayerInfo[playerid][pHelper] >= 1)
{
if(HelperDuty[playerid] == 1)
{
format(string, sizeof(string), "[Helper] %s (ID:%d) is now an off duty Helper", GetPlayerNameEx(playerid),playerid);
HelperMessage(COLOR_TESTERDUTY,string);
SetPlayerColor(playerid,COLOR_WHITE);
HelperDuty[playerid] = 0;

if(CopOnDuty[playerid] == 1)
{
SetPlayerArmour(playerid,100);
SetPlayerColor(playerid,0x8c8cfeff);
}
else if(MedicOnDuty[playerid] == 1)
{
SetPlayerColor(playerid,0xfe8281ff);
}
else
{
SetPlayerColor(playerid,COLOR_WHITE);
}
}
else
{
format(string, sizeof(string), "[Helper] %s (ID:%d) is now an on duty Helper", GetPlayerNameEx(playerid),playerid);
HelperMessage(COLOR_TESTERDUTY,string);
HelperDuty[playerid] = 1;
SetPlayerColor(playerid,COLOR_TESTERDUTY);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
}
return 1;
}

zDevon
07/06/2012, 05:41 AM
The above is also incorrect.
COMMAND:hduty(playerid, params[])
{
if(PlayerInfo[playerid][pHelper] >= 1)
{
if(HelperDuty[playerid] == 1)
{
format(string, sizeof(string), "[Helper] %s (ID:%d) is now an off duty Helper", GetPlayerNameEx(playerid),playerid);
HelperMessage(COLOR_TESTERDUTY,string);
SetPlayerColor(playerid,COLOR_WHITE);
HelperDuty[playerid] = 0;
if(CopOnDuty[playerid] == 1)
{
SetPlayerArmour(playerid,100);
SetPlayerColor(playerid,0x8c8cfeff);
}
else if(MedicOnDuty[playerid] == 1)
{
SetPlayerColor(playerid,0xfe8281ff);
}
else
{
SetPlayerColor(playerid,COLOR_WHITE);
}
}
else
{
format(string, sizeof(string), "[Helper] %s (ID:%d) is now an on duty Helper", GetPlayerNameEx(playerid),playerid);
HelperMessage(COLOR_TESTERDUTY,string);
HelperDuty[playerid] = 1;
SetPlayerColor(playerid,COLOR_TESTERDUTY);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
}
return 1;
}

Just fix the forum's auto indentation when you paste.

Neo Karls
07/06/2012, 08:57 AM
The Problem was you didnt closed the brackets and the last else you put it together with the else before it (forget to close the bracket before the last else).

COMMAND:hduty(playerid, params[])
{
if(PlayerInfo[playerid][pHelper] >= 1)
{
if(HelperDuty[playerid] == 1)
{
format(string, sizeof(string), "[Helper] %s (ID:%d) is now an off duty Helper", GetPlayerNameEx(playerid),playerid);
HelperMessage(COLOR_TESTERDUTY,string);
SetPlayerColor(playerid,COLOR_WHITE);
HelperDuty[playerid] = 0;

if(CopOnDuty[playerid] == 1)
{
SetPlayerArmour(playerid,100);
SetPlayerColor(playerid,0x8c8cfeff);
}
else if(MedicOnDuty[playerid] == 1)
{
SetPlayerColor(playerid,0xfe8281ff);
}
else
{
SetPlayerColor(playerid,COLOR_WHITE);
}
}
else
{
format(string, sizeof(string), "[Helper] %s (ID:%d) is now an on duty Helper", GetPlayerNameEx(playerid),playerid);
HelperMessage(COLOR_TESTERDUTY,string);
HelperDuty[playerid] = 1;
SetPlayerColor(playerid,COLOR_TESTERDUTY);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
}
return 1;
}

N0FeaR
07/06/2012, 09:27 AM
Thank you guys.

djcabo
07/06/2012, 09:30 AM
I Need Help! i Cant Compile cause This Fuckin Error

#if false == true
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
zTDM
Gamemode created by djcabo
Mapping by Nikz
Gm:TDM
Lines: 1.604
Mode:RP|Freeroam|Fun Gaming|TDM
Map: Los Santos
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
IMPORTANT NOTE:
Lines which are comments
should remain like that
or may be removed
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Authors' Notes
Scripter djcabo: You can freely edit this gamemode as long as you keep the credits
Mapper Nikz: Have Fun with the gamemode
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#endif

//=-=-=-=-=-=-=-=-=-=-=-=-=INCLUDES=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#include <a_samp>
#include <SpikeStrip>
//#include <dini>
//#include <YSI\y_ini>
//#include <dudb>
#include <SII> // < Best INI Reading/Writing System I found >
//=-=-=-=-=-=-=-=-=-=-=-=-=PRAGMAS=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#pragma tabsize 0
//#pragma unused ret_memcpy
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//=-=-=-=-=-=-=-=-=-=-=-=-=DEFINES=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//=-=-=-=-=-=-=-=-=-=-=-=-=TEAMS & GANGS=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#define TEAM_BALLAS ( 0 )
#define TEAM_GROVE ( 1 )
#define TEAM_POLICE ( 2 )
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//=-=-=-=-=-=-=-=-=-=-=-=-=DIALOG DEFINES=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4
#define DIALOG_SHOP 5
#define DIALOG_VIPSHOP 6
#define DIALOG_VEHVIPSHOP 7
#define DIALOG_POLICEHELP 8
#define DIALOG_POLICEHELP2 9
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//=-=-=-=-=-=-=-=-=-=-=-=-=ACCOUNT SAVING & LOADING PATH=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#define SAVE "zTDM/%s.ini"
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//=-=-=-=-=-=-=-=-=-=-=-=-=COLORS=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#define COLOR_GROVE 0x00FF80FF
#define COLOR_BALLAS 0x8000FFFF
#define COLOR_TKS 0x867F8CFF
#define BLACK 0x000000FF
#define COLOR_NG 0x04078AFF
#define COLOR_TM 0xFFAC38FF
#define COLOR_PRIMAR 0xB9F558FF
#define COLOR_HITMEN 0xFF030300
#define COLOR_TAXI 0xF7FF00FF
#define COLOR_SCHOOL 0x66CCFFFF
#define COLOR_REPORTER 0xC2A2DAFF
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_ALBASTRU 0x52FFE8AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_SEA 0x00808000
#define COLOR_BLUE 0x2641FEAA
#define COLOR_NICERED 0xFF0000FF
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_GRAD1 0xC8D2AEFF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define YELLOW 0xFFFF00AA
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_ALLDEPT 0xFF8282AA
#define COLOR_NEWS 0xFFA500AA
#define COLOR_OOC 0xE0FFFFAA
#define TEAM_CYAN 1
#define TEAM_BLUE 2
#define TEAM_GREEN 3
#define TEAM_ORANGE 4
#define TEAM_COR 5
#define TEAM_BAR 6
#define TEAM_TAT 7
#define TEAM_CUN 8
#define TEAM_STR 9
#define TEAM_HIT 10
#define TEAM_ADMIN 11
#define COLOR_Ballas 0xBF15EAFF
#define COLOR_Grove 0xFF8000FF
#define COLOR_yakuza 0x4992B4FF
#define COLOR_HITMAN 0xEA0000FF
#define COLOR_MAYOR 0xB3F856FF
#define COLOR_YELLOW 0xFFF700FF
#define COLOR_MEDIC 0xB0514FFF
#define COLOR_PD 0x4855F9FF
#define OBJECTIVE_COLOR 0x64000064
#define TEAM_GREEN_COLOR 0xFFFFFFAA
#define TEAM_JOB_COLOR 0xFFB6C1AA
#define TEAM_HIT_COLOR 0xFFFFFF00
#define TEAM_BLUE_COLOR 0x8D8DFF00
#define COLOR_ADD 0x63FF60AA
#define TEAM_Grove_COLOR 0x00D900C8
#define TEAM_GROVE_COLOR 0x00D900C8
#define TEAM_VAGOS_COLOR 0xFFC801C8
#define TEAM_Ballas_COLOR 0xD900D3C8
#define TEAM_BALLAS_COLOR 0xD900D3C8
#define TEAM_AZTECAS_COLOR 0x01FCFFC8
#define TEAM_CYAN_COLOR 0xFF8282AA
#define TEAM_ORANGE_COLOR 0xFF830000
#define TEAM_COR_COLOR 0x39393900
#define TEAM_BAR_COLOR 0x00D90000
#define TEAM_TAT_COLOR 0xBDCB9200
#define TEAM_CUN_COLOR 0xD900D300
#define TEAM_STR_COLOR 0x01FCFF00
#define TEAM_ADMIN_COLOR 0x00808000
#define COLOR_INVIS 0xAFAFAF00
#define COLOR_SPEC 0xBFC0C200
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//=-=-=-=-=-=-=-=-=-=-=-=-=FORWARDS=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
forward JailTimer(playerid);
forward Send();
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//=-=-=-=-=-=-=-=-=-=-=-=-=ENUMS=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
enum pInfo
{
AdminLevel,
Money,
Rank,
Kills,
Deaths,
Gang,
Password,
VIP,
}
new pStats[MAX_PLAYERS][pInfo];
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//=-=-=-=-=-=-=-=-=-=-=-=-=GLOBAL NEWs=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
new LoggedIn[MAX_PLAYERS];
new Jailed[MAX_PLAYERS];
new sirenon[MAX_PLAYERS];
new PolicePursuitVeh1;
new PolicePursuitVeh2;
new PolicePursuitVeh3;
new PolicePrisonierTransport;
new L1;
new L2;
new L3;
new L4;
new L5;
new L6;
new L7;
new L8;
new L9;
new B1;
new B2;
new B3;
new B4;
new G1;
new G2;
new G3;
new sirenturn[4];
new Killstreak[MAX_PLAYERS];
new MSGs[][] =
{
"Gamemode created by djcabo (www.djcabofreeroam.com)",
"Mapping done by Nikz (www.djcabofreeroam.com)",
"Type /shop to open the Shop !",
"Dj Cabo's Freeroam Forum(www.djcabofreeroam.com)"
};
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//=-=-=-=-=-=-=-=-=-=-=-=-=MAIN FUNCTION=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
main()
{
print("\n----------------------------------");
print(" Dj Cabo's Freeroam");
print("----------------------------------\n");
}
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


public OnGameModeInit()
{
// Set the GameMode Text
SetGameModeText("RP|Freeroam|Fun Gaming|TDM");
SetTimer("Send", 60000, true);
//=-=-=-=-=-=-=-=-=-=-=-=-=TEAM CLASSES=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AddPlayerClass(105,2526.2942,-1676.6444,19.9302,87.8721,24,200,0,0,0,0); // Grove [ID 0]
AddPlayerClass(106,2526.2942,-1676.6444,19.9302,87.8721,24,200,0,0,0,0); // Grove [ID 1]
AddPlayerClass(107,2526.2942,-1676.6444,19.9302,87.8721,24,200,0,0,0,0); // Grove [ID 2]
AddPlayerClass( 102, 2165.0474,-1674.9874,15.0859, 269.1425, 5, 0, 22, 100, 32, 50 ); // Ballas [ID 3]
AddPlayerClass(281,1527.4945,-1678.1912,5.8906,80.0,24,24,25,25,26,26); // Police [ID 4]
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

new siren1 = CreateObject( 19420,0,0,0,0,0,0,80 );
new siren2 = CreateObject( 19420,0,0,0,0,0,0,80 );
new siren3 = CreateObject( 19420,0,0,0,0,0,0,80 );
new siren4 = CreateObject( 19420,0,0,0,0,0,0,80 );
SetWeather(2);
PolicePrisonierTransport = AddStaticVehicle(428,1585.2485,-1667.6521,6.0162,269.8068,4,75); // Police Prisonier Transport <Securicar>
PolicePursuitVeh1 = AddStaticVehicle(541,1546.0282,-1676.0120,5.5156,91.2819,0,0); // Bullet
PolicePursuitVeh2 = AddStaticVehicle(559,1546.1516,-1684.7251,5.5469,88.0085,0,0); // Jester
PolicePursuitVeh3 = AddStaticVehicle(415,1546.5760,-1680.2844,5.6629,88.5523,0,0); // Cheetah
AttachObjectToVehicle( siren1, PolicePursuitVeh1, 0.000000, -0.200000, 0.599999, 0.000000, 0.000000, 0.000000 ); // Attach Siren to Bullet Police Pursuit Vehicle
AttachObjectToVehicle( siren2, PolicePursuitVeh2, 0.000000, -0.300000, 0.699999, 0.000000, 0.000000, 0.000000 ); // Attach Siren to Jester Police Pursuit Vehicle
AttachObjectToVehicle( siren3, PolicePursuitVeh3, -0.000000, -0.400000, 0.600000, 0.000000, 0.000000, 0.000000 ); // Attach Siren to Cheetah Police Pursuit Vehicle
AttachObjectToVehicle( siren4, PolicePrisonierTransport, 0.000000, 1.100000, 1.400000, 0.000000, 0.000000, 0.000000 ); // Attach Siren To Police Prisonier Transport <Securicar>
//L1 = AddStaticVehicle(596,1537.4346,-1667.9000,13.1842,0.1255,0,1); // LSPD POLICE 1
//L2 = AddStaticVehicle(596,1537.2668,-1677.6361,13.1840,0.4512,0,1); // LSPD POLICE 2
L3 = AddStaticVehicle(596,1601.1913,-1692.0131,5.6120,91.0192,0,1); // LSPD POLICE 3
L4 = AddStaticVehicle(596,1600.2858,-1687.8815,5.6110,90.0246,0,1); // LSPD POLICE 4
L5 = AddStaticVehicle(596,1600.6755,-1684.0406,5.6095,90.7031,0,1); // LSPD POLICE 5
L6 = AddStaticVehicle(596,1602.0184,-1696.0391,5.6115,90.3589,0,1); // LSPD POLICE 6
L7 = AddStaticVehicle(596,1602.1854,-1700.3385,5.6106,90.0405,0,1); // LSPD POLICE 7
L8 = AddStaticVehicle(596,1595.3568,-1709.7322,5.6109,0.7877,0,1); // LSPD POLICE 8
L9 = AddStaticVehicle(596,1591.3458,-1710.2609,5.6107,359.8351,0,1); // LSPD POLICE 9
B1 = AddStaticVehicle(517,2183.5488,-1680.4927,13.8720,349.5660,126,126); // BALLAS 1
B2 = AddStaticVehicle(517,2187.6731,-1662.8025,14.7008,347.1707,126,126); // BALLAS 2
B3 = AddStaticVehicle(518,2164.3962,-1684.3077,14.7567,320.1696,126,126); // BALLAS 3
B4 = AddStaticVehicle(518,2166.4600,-1686.0868,14.7567,341.5892,126,126); // BALLAS 4
G1 = AddStaticVehicle(517,2509.6941,-1668.0394,13.3056,6.9947,86,86); // GROVE 1
G2 = AddStaticVehicle(517,2497.8762,-1683.5112,13.2356,281.1148,86,86); // GROVE 2
G3 = AddStaticVehicle(517,2500.9380,-1655.1943,13.3001,69.3356,86,86); // GROVE 3
//=-=-=-=-=-=-=-=-=-=-=-=-=MAPS BY Nikz=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
CreateObject(2924,266.20001221,83.80000305,1001.20 001221,0.00000000,0.00000000,92.00000000); //object(kmb_crash3door) (1)
CreateObject(2924,266.29998779,88.50000000,1001.20 001221,0.00000000,0.00000000,92.00000000); //object(kmb_crash3door) (2)
CreateObject(2603,263.20001221,85.80000305,1000.50 000000,0.00000000,0.00000000,0.00000000); //object(police_cell_bed) (2)
CreateObject(2602,263.00000000,87.80000305,1000.59 997559,0.00000000,0.00000000,89.99993896); //object(police_cell_toilet) (1)
CreateObject(2603,263.29998779,81.19999695,1000.50 000000,0.00000000,0.00000000,0.00000000); //object(police_cell_bed) (3)
CreateObject(2602,263.00000000,83.40000153,1000.59 997559,0.00000000,0.00000000,0.00000000); //object(police_cell_toilet) (2)
CreateObject(1499,1582.59997559,-1637.80004883,12.50000000,0.00000000,0.00000000,0. 00000000); //object(gen_doorint05) (2)
CreateObject(970,1535.40002441,-1664.00000000,12.89999962,0.00000000,0.00000000,0. 00000000); //object(fencesmallb) (1)
CreateObject(970,1535.30004883,-1681.40002441,12.89999962,0.00000000,0.00000000,0. 00000000); //object(fencesmallb) (2)
CreateObject(970,1537.40002441,-1679.19995117,12.89999962,0.00000000,0.00000000,90 .00000000); //object(fencesmallb) (3)
CreateObject(970,1537.40002441,-1674.80004883,12.89999962,0.00000000,0.00000000,90 .00000000); //object(fencesmallb) (4)
CreateObject(970,1537.40002441,-1670.50000000,12.89999962,0.00000000,0.00000000,90 .00000000); //object(fencesmallb) (6)
CreateObject(970,1537.40002441,-1666.19995117,12.89999962,0.00000000,0.00000000,90 .00000000); //object(fencesmallb) (7)
CreateObject(970,1533.19995117,-1666.09997559,12.89999962,0.00000000,0.00000000,90 .00000000); //object(fencesmallb) (8)
CreateObject(970,1533.19995117,-1670.40002441,12.89999962,0.00000000,0.00000000,90 .00000000); //object(fencesmallb) (9)
CreateObject(970,1533.19995117,-1674.69995117,12.89999962,0.00000000,0.00000000,90 .00000000); //object(fencesmallb) (10)
CreateObject(970,1533.19995117,-1679.09997559,12.89999962,0.00000000,0.00000000,90 .00000000); //object(fencesmallb) (11)
CreateObject(8990,1536.50000000,-1674.40002441,13.10000038,0.00000000,0.00000000,27 0.00000000); //object(bush11_lvs) (1)
CreateObject(8991,1536.50000000,-1671.09997559,13.10000038,0.00000000,0.00000000,27 0.00000000); //object(bush12_lvs) (1)
CreateObject(8991,1535.80004883,-1671.69995117,13.10000038,0.00000000,0.00000000,26 9.99450684); //object(bush12_lvs) (2)
CreateObject(8990,1535.80004883,-1674.30004883,13.10000038,0.00000000,0.00000000,26 9.99450684); //object(bush11_lvs) (2)
CreateObject(8990,1535.00000000,-1671.30004883,13.10000038,0.00000000,0.00000000,26 9.99450684); //object(bush11_lvs) (3)
CreateObject(8991,1535.30004883,-1674.50000000,13.10000038,0.00000000,0.00000000,26 9.99450684); //object(bush12_lvs) (3)
CreateObject(8990,1534.09997559,-1671.19995117,13.10000038,0.00000000,0.00000000,26 9.99450684); //object(bush11_lvs) (4)
CreateObject(8991,1534.50000000,-1674.59997559,13.10000038,0.00000000,0.00000000,26 9.99450684); //object(bush12_lvs) (4)
CreateObject(8990,1533.90002441,-1671.50000000,13.10000038,0.00000000,0.00000000,26 9.99450684); //object(bush11_lvs) (5)
CreateObject(8991,1533.90002441,-1674.09997559,13.10000038,0.00000000,0.00000000,26 9.99450684); //object(bush12_lvs) (5)

//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

return 1;
}

public JailTimer(playerid)
{
SpawnPlayer(playerid);
GameTextForPlayer(playerid,"~w~Released~r~From~n~~g~Jail",3000,1);
SetPlayerPos(playerid,1537.7169,-1675.8016,13.5469);
Jailed[playerid] = 0;
}
public Send()
{
new MSG = random(sizeof(MSGs));
SendClientMessageToAll(COLOR_LIGHTBLUE, MSGs[MSG]);
}
public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
switch ( classid )
{
case 0: // [CLASSID 0]
{
SetPlayerPos(playerid,2526.2942,-1676.6444,19.9302);
SetPlayerFacingAngle(playerid,87.8270);
SetPlayerCameraPos(playerid,2526.2942,-1676.6444,19.9302);
SetPlayerCameraLookAt(playerid,2526.2942,-1676.6444,19.9302);
GameTextForPlayer( playerid, "~r~Grove", 300, 3 );
SetPlayerTeam( playerid, TEAM_GROVE );
}

case 1: // [CLASSID 1]
{
SetPlayerPos(playerid,2526.2942,-1676.6444,19.9302);
SetPlayerFacingAngle(playerid,87.8270);
SetPlayerCameraPos(playerid,2526.2942,-1676.6444,19.9302);
SetPlayerCameraLookAt(playerid,2526.2942,-1676.6444,19.9302);
GameTextForPlayer( playerid, "~g~GROVE", 300, 3 );
SetPlayerTeam( playerid, TEAM_GROVE );
}

case 2: // [CLASSID 2]
{
SetPlayerPos(playerid,2526.2942,-1676.6444,19.9302);
SetPlayerFacingAngle(playerid,87.8270);
SetPlayerCameraPos(playerid,2526.2942,-1676.6444,19.9302);
SetPlayerCameraLookAt(playerid,2526.2942,-1676.6444,19.9302);
GameTextForPlayer( playerid, "~g~GROVE", 300, 3 );
SetPlayerTeam( playerid, TEAM_GROVE );
}
case 3: // [CLASSID 3]
{
SetPlayerPos(playerid,2165.0474,-1674.9874,15.0859);
SetPlayerFacingAngle(playerid,87.8270);
SetPlayerCameraPos(playerid,2165.0474,-1674.9874,15.0859);
SetPlayerCameraLookAt(playerid,2165.0474,-1674.9874,15.0859);
GameTextForPlayer( playerid, "~p~BALLAS", 300, 3 );
SetPlayerTeam( playerid, TEAM_BALLAS );
}
case 4: // [CLASSID 4]
{
SetPlayerPos(playerid,1537.7169,-1675.8016,13.5469);
SetPlayerFacingAngle(playerid,87.8270);
SetPlayerCameraPos(playerid,1537.7169,-1675.8016,13.5469);
SetPlayerCameraLookAt(playerid,1537.7169,-1675.8016,13.5469);
GameTextForPlayer(playerid,"~b~POLICE",300,3);
SetPlayerTeam(playerid,TEAM_POLICE);
}
}
return 1;
}

public OnPlayerConnect(playerid)
{
new string[128];
format(string,sizeof(string),"[JOIN] %s has joined the server !",PlayerName(playerid));
SendClientMessageToAll(COLOR_NICERED,string);
//=-=-=-=-=-=-=-=-=-=-=-=-=REGISTER & LOGIN=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
LoggedIn[playerid] = 0;
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(fexist(SAVE_PATH(playerid)))
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "This Account name is registered , input the password below to log in !", "Login", "Leave");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register Account", "This Account name is not registered, input a password below to register !", "Register", "Leave");
}
return 1;
}
//=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


public OnPlayerDisconnect(playerid, reason)
{
new string[128];
format(string,sizeof(string),"[LEAVE] %s has left the server !",PlayerName(playerid));
SendClientMessageToAll(COLOR_NICERED,string);
if(INI_Open(SAVE_PATH(playerid))) {
INI_WriteInt("Money",GetPlayerMoney(playerid));
INI_WriteInt("AdminLevel",pStats[playerid][AdminLevel]);
INI_WriteInt("VIP",pStats[playerid][VIP]);
INI_WriteInt("Kills",pStats[playerid][Kills]);
INI_WriteInt("Deaths",pStats[playerid][Deaths]);
INI_WriteInt("Rank",pStats[playerid][Rank]);
INI_Save();
INI_Close();
LoggedIn[playerid] = 0;
}
return 1;
}

public OnPlayerSpawn(playerid)
{
new string[128];
new idx;
new sendername[ MAX_PLAYER_NAME ];
#pragma unused idx
#pragma unused sendername
ResetPlayerWeapons(playerid);
if(GetPlayerTeam(playerid) == TEAM_BALLAS)
{
SendClientMessage(playerid,COLOR_PINK,"You have spawned as Ballas !");
SendClientMessage(playerid,COLOR_PINK,"You have been given a Deagle !");
GivePlayerWeapon(playerid,24,24);
SetPlayerHealth(playerid,100);
SetPlayerColor(playerid,COLOR_PURPLE);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pStats[i][AdminLevel] >= 1)
{
format(string,sizeof(string),"[ADMIN] %s has spawned as Ballas !",PlayerName(playerid));
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
}
}
if(GetPlayerTeam(playerid) == TEAM_GROVE)
{
SendClientMessage(playerid,COLOR_GREEN,"You have spawned as Grove !");
SendClientMessage(playerid,COLOR_GREEN,"You have been given a Deagle !");
GivePlayerWeapon(playerid,24,24);
SetPlayerHealth(playerid,100);
SetPlayerColor(playerid,COLOR_GREEN);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pStats[i][AdminLevel] >= 1)
{
format(string,sizeof(string),"[ADMIN] %s has spawned as Grove !",PlayerName(playerid));
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
}
}
if(GetPlayerTeam(playerid) == TEAM_POLICE)
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have spawned as Police !");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have been given Police Equipment !");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Type /policehelp for information & help about your duty !");
GivePlayerWeapon(playerid,24,200);
GivePlayerWeapon(playerid,31,500);
GivePlayerWeapon(playerid,25,100);
GivePlayerWeapon(playerid,29,500);
GivePlayerWeapon(playerid,17,50);
GivePlayerWeapon(playerid,3,999);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
SetPlayerColor(playerid,COLOR_BLUE);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pStats[i][AdminLevel] >= 1)
{
format(string,sizeof(string),"[ADMIN] %s has spawned as Police !",PlayerName(playerid));
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
}
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(Jailed[playerid] == 1)
{
SetPlayerPos(playerid,264.6237,86.1668,1001.0391);
SetPlayerInterior(playerid,6);
SendClientMessage(playerid,COLOR_NICERED,"You haven't finished your jail time !");
}
SetPlayerWantedLevel(killerid,6);
SendClientMessage(killerid,COLOR_PURPLE,"You have committed a Crime: First Degree Murder");
SendClientMessage(killerid,COLOR_PURPLE,"Your Current Wanted Level: 6");
SetPlayerColor(playerid,COLOR_NICERED);
if(GetPlayerWantedLevel(playerid) >= 1)
{
if(GetPlayerTeam(killerid) == TEAM_POLICE)
{
new SuspectDeath[128];
SendClientMessage(killerid,COLOR_LIGHTBLUE,"Congratulations! You have killed a Suspect !");
SendClientMessage(killerid,COLOR_LIGHTBLUE,"You receive 5000$ for killing a Suspect !");
format(SuspectDeath, 128, "~w~Suspect~r~Killed~n~Bonus~g~$5000");
GameTextForPlayer(killerid, SuspectDeath, 5000, 1);
SendClientMessage(playerid,COLOR_NICERED,"You have been killed by an Officer. You are jailed for 300 Seconds");
SetTimer("JailTimer",300000,false); // Jailed for 300 seconds
new Skill[128];
format(Skill,128,"Police Officer %s has neutralized Suspect %s",PlayerName(killerid),PlayerName(playerid));
SendClientMessageToAll(COLOR_PURPLE,Skill);
SetPlayerPos(playerid,264.6237,86.1668,1001.0391);
SetPlayerInterior(playerid,6);
Jailed[playerid] = 1;
}
}

pStats[playerid][Deaths]++;
pStats[killerid][Kills]++;
SendClientMessage(killerid,COLOR_LIGHTBLUE,"INFO: You killed an enemy and you've been rewarded 2000$ !");
pStats[killerid][Money]+=2000;
GivePlayerMoney(killerid,2000);
Killstreak[killerid]++;
Killstreak[playerid] = 0;
if(Killstreak[killerid] == 3)
{
new string[128];
format(string,128,"INFO: %s has made a Killstreak of 3 and has been rewarded 5000$ !",PlayerName(killerid));
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
pStats[killerid][Money]+=5000;
GivePlayerMoney(killerid,5000);
Killstreak[killerid]++;
Killstreak[playerid] = 0;
}
if(Killstreak[killerid] == 6)
{
new string[128];
format(string,128,"INFO: %s has made a Killstreak of 6 and has been rewarded 10000$ !",PlayerName(killerid));
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
pStats[killerid][Money]+=10000;
GivePlayerMoney(killerid,10000);
Killstreak[killerid]++;
Killstreak[playerid] = 0;
}
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
if(vehicleid == PolicePursuitVeh1)
{
DestroyObject(sirenturn[0]);
}
if(vehicleid == PolicePursuitVeh2)
{
DestroyObject(sirenturn[1]);
}
if(vehicleid == PolicePursuitVeh3)
{
DestroyObject(sirenturn[2]);
}
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
/*new tmp[128];
new idx;
new giveplayer[MAX_PLAYER_NAME];
new para1;*/
new string[128];
//new sendername[MAX_PLAYER_NAME];
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
new sendername[ MAX_PLAYER_NAME ];
if (strcmp("/makeadmin", cmd, true) == 0)
{
//new string[128];
new tmp[256];
new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if (pStats[playerid][AdminLevel] >= 8)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /makeadmin [playerid] [level]");
SendClientMessage(playerid, COLOR_ORANGE, "FUNCTION: Set the admin level of a player.");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new level = strval(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
pStats[giveplayerid][AdminLevel] = level;
printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
format(string, sizeof(string), "You have been promoted to admin level %d by %s.", level, player);
SendClientMessage(giveplayerid, 0x00C2ECFF, string);
format(string, sizeof(string), "You have given %s level %d admin.", giveplayer,pStats[giveplayerid][AdminLevel]);
SendClientMessage(playerid, 0x00C2ECFF, string);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%i is not an active player.", giveplayerid);
SendClientMessage(playerid, 0xE60000FF, string);
}
}
else
{
SendClientMessage(playerid, 0xE60000FF, "You are not the server owner!");
}
return 1;
}
if(strcmp("/spikestrip",cmd,true) == 0)
{
if(GetPlayerTeam(playerid) == TEAM_POLICE)
{
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
CreateStrip(plocx,plocy,plocz,ploca);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have placed a spike strip at your position");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerTeam(i) == TEAM_POLICE)
{
format(string,sizeof(string),"Police Officer %s has placed a spikestrip !",PlayerName(playerid));
SendClientMessage(i,COLOR_PURPLE,string);
}
}
}
return 1;
}
if(strcmp("/removespikestrip",cmd,true) == 0)
{
DeleteClosestStrip(playerid);
return 1;
}
if(strcmp("/kick",cmd,true) == 0)
{
new tmp[256];
new giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if(pStats[playerid][AdminLevel] >= 1)
{
tmp = strtok(cmdtext, idx);
giveplayerid = ReturnUser(tmp), GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Correct Usage:{FFFFFF} /kick [playerid/PartOfName] [reason]");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Correct Usage:{FFFFFF} /kick [playerid/PartOfName] [reason]");
return 1;
}
format(string, sizeof(string), "%s was kicked by Admin %s, reason: %s", giveplayer,PlayerName(playerid), (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(giveplayerid);
}
return 1;
}
if(strcmp("/ban",cmd,true) == 0)
{
new tmp[256];
new giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if(pStats[playerid][AdminLevel] >= 1)
{
tmp = strtok(cmdtext, idx);
giveplayerid = ReturnUser(tmp), GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Correct Usage:{FFFFFF} /ban [playerid/PartOfName] [reason]");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Correct Usage:{FFFFFF} /ban [playerid/PartOfName] [reason]");
return 1;
}
format(string, sizeof(string), "%s was banned by Admin %s, reason: %s", giveplayer, PlayerName(playerid), (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
Ban(giveplayerid);
}
return 1;
}
if(strcmp("/policehelp",cmd,true) == 0)
{
ShowPlayerDialog(playerid,DIALOG_POLICEHELP,DIALOG _STYLE_MSGBOX,"Police Help","In your Police Officer Duty you must remember:\n{FC0000}RED{FFFFFF}- Wanted Player you must kill him/her\n{11BF11}Green{FFFFFF}- Player is in Grove Gang\n{CB18DB}Purple{FFFFFF}- Player is in Ballas Gang","OK","Police Commands");
return 1;
}
if(strcmp("/getmypos",cmd,true) == 0) // This Command
{ // Is for testing
new Float:x; // You can delete/comment it
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
format(string,sizeof(string),"%f,%f,%f",x,y,z);
SendClientMessage(playerid,COLOR_NICERED,string);
printf(string);
return 1;
}
if(strcmp("/pd",cmd,true) == 0) // This command is for testing
{ // You can delete/comment it
SetPlayerPos(playerid,1546.0282,-1676.0120,5.5156);
return 1;
}
if(strcmp("/vspawn",cmd,true) == 0) // This command is for testing
{ // You can delete/comment it
new tmp[256];
tmp = strtok(cmdtext,idx);
new id = strval(tmp);
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(id,x,y,z,80.0,1,1,999999999);
return 1;
}
if(strcmp("/r",cmd,true) == 0 || strcmp("/radio",cmd,true) == 0)
{
if(GetPlayerTeam(playerid) != TEAM_POLICE) return SendClientMessage(playerid,COLOR_NICERED,"You're not a Cop !");
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"Correct Usage: /radio [TEXT]");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerTeam(i) == TEAM_POLICE)
{
format(string,sizeof(string),"[POLICE RADIO] Police Officer %s : %s",PlayerName(playerid),result);
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
}
return 1;
}
if(strcmp("/gc",cmd,true) == 0 || strcmp("/gangchat",cmd,true) == 0)
{
if(GetPlayerTeam(playerid) == TEAM_POLICE) return SendClientMessage(playerid,COLOR_NICERED,"You're not a Gang Member ! Use /radio instead !");
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"Correct Usage: /gangchat [TEXT]");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerTeam(playerid) == TEAM_GROVE)
{
if(GetPlayerTeam(i) == TEAM_GROVE)
{
format(string,sizeof(string),"[GANG CHAT] Gang Member %s : %s",PlayerName(playerid),result);
SendClientMessage(i,COLOR_GREEN,string);
}
}
if(GetPlayerTeam(playerid) == TEAM_BALLAS)
{
if(GetPlayerTeam(i) == TEAM_BALLAS)
{
format(string,sizeof(string),"[GANG CHAT] Gang Member %s : %s",PlayerName(playerid),result);
SendClientMessage(i,COLOR_PURPLE,string);
}
}
}
return 1;
}
if(strcmp("/setweather",cmd,true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext,idx);
new id = strval(tmp);
SetPlayerWeather(playerid,id);
return 1;
}

if (strcmp("/setmoney",cmd,true) == 0)
{
new tmp[256];
new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if(pStats[playerid][AdminLevel] >=2)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /setmoney [playerid] [money]");
SendClientMessage(playerid, COLOR_ORANGE, "FUNCTION: Set the money of a player.");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new money = strval(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
pStats[giveplayerid][Money] = money;
ResetPlayerMoney(giveplayerid);
GivePlayerMoney(playerid,money);
printf("Admin %s has set %s's money to %d.", player, giveplayer, money);
format(string, sizeof(string), "Your money has been set to %d by %s.", money, player);
SendClientMessage(giveplayerid, 0x00C2ECFF, string);
format(string, sizeof(string), "You have set %s's money to %d.", giveplayer,pStats[giveplayerid][Money]);
SendClientMessage(playerid, 0x00C2ECFF, string);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%i is not an active player.", giveplayerid);
SendClientMessage(playerid, 0xE60000FF, string);
}
}
else
{
SendClientMessage(playerid, 0xE60000FF, "You are not a Regular Admin!");
}
return 1;
}

if (strcmp("/admins", cmdtext, true) == 0)
{
SendClientMessage(playerid,COLOR_GREEN,"Administrators Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pStats[i][AdminLevel] == 1)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Trial Admin - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, 0xFFD500FF, string);
}
if(pStats[i][AdminLevel] == 2)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Regular Admin - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, 0x4EB1CFFF, string);
}
if(pStats[i][AdminLevel] == 3)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Super Admin - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, 0xB966DCFF, string);
}
if(pStats[i][AdminLevel] == 4)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Lead Admin - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, 0x6ADC66FF, string);
}
if(pStats[i][AdminLevel] == 5)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Super Lead Admin - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, 0xFF6A6AFF, string);
}
if(pStats[i][AdminLevel] == 6)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Head Admin - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, 0x6AFFF0FF, string);
}
if(pStats[i][AdminLevel] == 7)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Co-Owner - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(pStats[i][AdminLevel] == 8)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Owner - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, 0xFF0000FF, string);
}
}
return 1;
}
if(strcmp("/shop",cmd,true) == 0)
{
ShowPlayerDialog(playerid,DIALOG_SHOP,DIALOG_STYLE _LIST,"Weapons Shop","AK-47 $5000\nM4 $4500\nDeagle $2000\nMP5 $2500\nUzi $3000\nVIP Shop","Buy","Exit");
return 1;
}
if (strcmp("/makevip", cmd, true) == 0)
{
//new string[128];
new tmp[256];
new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if (pStats[playerid][AdminLevel] >= 4)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /makevip [playerid] [level]");
SendClientMessage(playerid, COLOR_ORANGE, "FUNCTION: Set the VIP level of a player.");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new level = strval(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
pStats[giveplayerid][VIP] = level;
printf("Admin %s made %s a level %d VIP.", player, giveplayer, level);
format(string, sizeof(string), "You have been promoted to VIP level %d by %s.", level, player);
SendClientMessage(giveplayerid, 0x00C2ECFF, string);
format(string, sizeof(string), "You have given %s level %d VIP.", giveplayer,pStats[giveplayerid][VIP]);
SendClientMessage(playerid, 0x00C2ECFF, string);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%i is not an active player.", giveplayerid);
SendClientMessage(playerid, 0xE60000FF, string);
}
}
else
{
SendClientMessage(playerid, 0xE60000FF, "You are not a Lead Admin!");
}
return 1;
}
if (strcmp("/vips", cmdtext, true) == 0)
{
SendClientMessage(playerid,COLOR_GREEN,"VIPs Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pStats[i][VIP] == 1)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Simple VIP - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, 0xFFD500FF, string);
}
if(pStats[i][VIP] == 2)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Regular VIP - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, 0x4EB1CFFF, string);
}
if(pStats[i][VIP] == 3)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "Super VIP - %s[ID: %d]", sendername,i);
SendClientMessage(playerid, 0xB966DCFF, string);
}

}
return 1;
}
return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new veh = GetPlayerVehicleID(playerid);
if(veh == PolicePursuitVeh1 || veh == PolicePursuitVeh2 || veh == PolicePursuitVeh3 && GetPlayerTeam(playerid) != TEAM_POLICE)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_NICERED,"You're not a Cop!");
}
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
new gang = GetPlayerTeam(playerid);
if(veh == PolicePursuitVeh1 || veh == PolicePursuitVeh2 || veh == PolicePursuitVeh3 || veh == PolicePrisonierTransport || veh == L1 || veh == L2 || veh == L3 || veh == L4 || veh == L5 || veh == L6 || veh == L7 || veh == L8 || veh == L9)
{
if(gang != TEAM_POLICE)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_PURPLE,"You have committed a Crime: Stealing A Police Vehicle");
SendClientMessage(playerid,COLOR_PURPLE,"Your Current Wanted Level: 3");
SetPlayerWantedLevel(playerid,3);
SetPlayerColor(playerid,COLOR_NICERED);
SendClientMessage(playerid,COLOR_NICERED,"You're not a Cop!");
}
}
if(veh == G1 || veh == G2 || veh == G3)
{
if(gang != TEAM_GROVE)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_NICERED,"You're not in Grove Gang !");
}
}
if(veh == B1 || veh == B2 || veh == B3 || veh == B4)
{
if(gang != TEAM_BALLAS)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_NICERED,"You're not in Ballas Gang !");
}
}
}
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)
{
if (newkeys & KEY_CROUCH)
{
new veh = GetPlayerVehicleID(playerid);
if(veh == PolicePursuitVeh1)
{
if(sirenon[playerid] == 1)
{
DestroyObject(sirenturn[0]);
//SendClientMessage(playerid,COLOR_RED,"Destroyed");
sirenon[playerid] = 0;
}
else
{
sirenturn[0] = CreateObject( 19419,0,0,0,0,0,0,80 );
AttachObjectToVehicle( sirenturn[0], PolicePursuitVeh1, 0.000000, -0.200000, 0.599999, 0.000000, 0.000000, 0.000000 ); // Turn on The Siren on the Bullet Police Pursuit Vehicle
sirenon[playerid] = 1;
}
}
else if(veh == PolicePursuitVeh2)
{
/*new sirenturn2; sirenturn2 = */
if(sirenon[playerid] == 1)
{
DestroyObject(sirenturn[1]);
sirenon[playerid] = 0;
}
else
{
sirenturn[1] = CreateObject( 19419,0,0,0,0,0,0,80 );
AttachObjectToVehicle( sirenturn[1], PolicePursuitVeh2, 0.000000, -0.300000, 0.699999, 0.000000, 0.000000, 0.000000 ); // Attach Siren to Jester Police Pursuit Vehicle
sirenon[playerid] = 1;
}
}
else if(veh == PolicePursuitVeh3)
{
/*new sirenturn3; sirenturn3 = */
if(sirenon[playerid] == 1)
{
DestroyObject(sirenturn[2]);
sirenon[playerid] = 0;
}
else
{
sirenturn[2] = CreateObject( 19419,0,0,0,0,0,0,80 );
AttachObjectToVehicle( sirenturn[2], PolicePursuitVeh3, -0.000000, -0.400000, 0.600000, 0.000000, 0.000000, 0.000000 ); // Attach Siren to Cheetah Police Pursuit Vehicle
sirenon[playerid] = 1;
}
}
else if(veh == PolicePrisonierTransport)
{
/*new sirenturn3; sirenturn3 = */
if(sirenon[playerid] == 1)
{
DestroyObject(sirenturn[3]);
sirenon[playerid] = 0;
}
else
{
sirenturn[3] = CreateObject( 19419,0,0,0,0,0,0,80 );
AttachObjectToVehicle( sirenturn[3], PolicePrisonierTransport, 0.000000, 1.100000, 1.400000, 0.000000, 0.000000, 0.000000 ); // Attach Siren to Cheetah Police Pursuit Vehicle
sirenon[playerid] = 1;
}
}
}
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
if(pStats[playerid][Kills] == 50)
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: Because you made 50 kils you have been promoted to Rank 2 !");
new string[128];
format(string,128,"INFO: %s has made 50 kills and has been promoted to Rank 2 !",PlayerName(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
pStats[playerid][Rank] = 2;
}
if(!IsPlayerConnected(playerid)) return 0;

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
for(new i = 0; i < sizeof(SpikeInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
{
if(SpikeInfo[i][sCreated] == 1)
{
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
tires = encode_tires(1, 1, 1, 1);
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
return 0;
}
}
}
}

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[])
{
switch(dialogid)
{

case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
if(INI_Open(SAVE_PATH(playerid))) {
INI_WriteString("Password",inputtext);
INI_WriteInt("Money",0);
INI_WriteInt("AdminLevel",0);
INI_WriteInt("VIP",0);
INI_WriteInt("Kills",0);
INI_WriteInt("Deaths",0);
//INI_WriteString("Gang","None");
INI_WriteInt("Rank",1);
INI_Save();
INI_Close();
}
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "This Account name is registered , input the password below to log in !", "Login", "Leave");
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
GivePlayerMoney(playerid,7000);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have been given $7000 start bonus !");
pStats[playerid][Money] = GetPlayerMoney(playerid);
//ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"Success!","Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
}
}
case DIALOG_SHOP:
{
if(!response) { }
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid,COLOR_RED,"You do not have enough money !");
GivePlayerMoney(playerid,-5000);
GivePlayerWeapon(playerid,30,500);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought an AK-47 for 5000$ !");
}
case 1:
{
if(GetPlayerMoney(playerid) < 4500) return SendClientMessage(playerid,COLOR_RED,"You do not have enough money !");
GivePlayerMoney(playerid,-4500);
GivePlayerWeapon(playerid,31,500);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought a M4 for 4500$ !");
}
case 2:
{
if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid,COLOR_RED,"You do not have enough money !");
GivePlayerMoney(playerid,-2000);
GivePlayerWeapon(playerid,24,100);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought a Deagle for 2000$ !");
}
case 3:
{
if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid,COLOR_RED,"You do not have enough money !");
GivePlayerMoney(playerid,-2500);
GivePlayerWeapon(playerid,29,300);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought a MP5 for 2500$ !");
}
case 4:
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid,COLOR_RED,"You do not have enough money !");
GivePlayerMoney(playerid,-3000);
GivePlayerWeapon(playerid,28,300);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought an UZI for 3000$ !");
}
case 5:
{
if(pStats[playerid][VIP] >= 1)
{
ShowPlayerDialog(playerid,DIALOG_VIPSHOP,DIALOG_ST YLE_LIST,"VIP SHOP","Grenades\t$5000\nMolotovs\t$4000\nSawn-off Shotgun\t$3500\nRPG\t$10000\nHS RPG\t$12000\nFlamethrower\t$20000\nVIP Vehicle Shop\tVIP Level 2","Buy","Exit");
} else return SendClientMessage(playerid,COLOR_RED,"You are not a VIP !");
}
}
}
}
case DIALOG_VIPSHOP:
{
if(!response) { }
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid,COLOR_NICERED,"You do not have enough money !");
GivePlayerMoney(playerid,-5000);
GivePlayerWeapon(playerid,16,10);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought 10 Grenades for 5000$ !");
}
case 1:
{
if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid,COLOR_NICERED,"You do not have enough money !");
GivePlayerMoney(playerid,-4000);
GivePlayerWeapon(playerid,18,10);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought 10 Molotovs for 4000$ !");
}
case 2:
{
if(GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid,COLOR_NICERED,"You do not have enough money !");
GivePlayerMoney(playerid,-3500);
GivePlayerWeapon(playerid,26,100);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought a Sawn-off Shotgun for 3500$ !");
}
case 3:
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid,COLOR_NICERED,"You do not have enough money !");
GivePlayerMoney(playerid,-10000);
GivePlayerWeapon(playerid,35,10);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought a RPG for 10000$ !");
}
case 4:
{
if(GetPlayerMoney(playerid) < 12000) return SendClientMessage(playerid,COLOR_NICERED,"You do not have enough money !");
GivePlayerMoney(playerid,-12000);
GivePlayerWeapon(playerid,36,10);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought a HS RPG for 12000$ !");
}
case 5:
{
if(GetPlayerMoney(playerid) < 20000) return SendClientMessage(playerid,COLOR_NICERED,"You do not have enough money !");
GivePlayerMoney(playerid,-20000);
GivePlayerWeapon(playerid,37,200);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have bought a Flamethrower for 20000$ !");
}
case 6:
{
if(pStats[playerid][VIP] < 2) return SendClientMessage(playerid,COLOR_RED,"You are not VIP Level 2 !");
ShowPlayerDialog(playerid,DIALOG_VEHVIPSHOP,DIALOG _STYLE_LIST,"VIP Vehicle Shop","Infernus\t8000$\nGreenwood\t5000$\nMajestic\t4000$ \nNRG-500\t10000$\nHydra\t12000$\nTank\t15000$","Buy","Exit");
}
}
}
}
case DIALOG_VEHVIPSHOP:
{
if(!response) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have closed the VIP Vehicle Shop !");
if(response)
{
switch(listitem)
{

case 0:
{
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(411,x,y,z,80.0,1,1,99999999999);
GivePlayerMoney(playerid,-8000);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have spawned an Infernus for 8000$ ! ");
}
case 1:
{
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(492,x,y,z,80.0,1,1,99999999999);
GivePlayerMoney(playerid,-5000);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have spawned a Greenwood for 5000$ ! ");
}
case 2:
{
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(517,x,y,z,80.0,1,1,99999999999);
GivePlayerMoney(playerid,-4000);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have spawned a Majestic for 4000$ ! ");
}
case 3:
{
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x,y,z,80.0,1,1,99999999999);
GivePlayerMoney(playerid,-10000);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have spawned a NRG-500 for 10000$ ! ");
}
case 4:
{
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(520,x,y,z,80.0,1,1,99999999999);
GivePlayerMoney(playerid,-12000);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have spawned a Hydra for 12000$ ! ");
}
case 5:
{
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(432,x,y,z,80.0,1,1,99999999999);
GivePlayerMoney(playerid,-15000);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"INFO: You have spawned a Tank for 15000$ ! ");
}
}
}
}
case DIALOG_POLICEHELP:
{
if(response == 1)
{
ShowPlayerDialog(playerid,DIALOG_POLICEHELP2,DIALO G_STYLE_MSGBOX,"Police Commands","{FFFFFF}/[r]adio - A Police radio\nspikestrip - Place a spikestrip\nremovespikestrip - Remove a spikestrip","OK","");
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
//INI_ParseFile(SAVE_PATH(playerid),"LoadStats_%s", .bExtra = true, .extra = playerid); print("Stats Loaded !");
if(INI_Open(SAVE_PATH(playerid))) {
INI_ReadString(pStats[playerid][Password],"Password",20);

if(inputtext[playerid] == pStats[playerid][Password])
{

GivePlayerMoney(playerid, INI_ReadInt("Money"));
pStats[playerid][AdminLevel] = INI_ReadInt("AdminLevel");
pStats[playerid][Kills] = INI_ReadInt("Kills");
pStats[playerid][Deaths] = INI_ReadInt("Deaths");
pStats[playerid][VIP] = INI_ReadInt("VIP");
pStats[playerid][Money] = INI_ReadInt("Money");
pStats[playerid][Rank] = INI_ReadInt("Rank");
INI_Close();
LoggedIn[playerid] = 1;
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"Success!","You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
}
}
return 1;
}
}
}
return 1;
}


public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
//=-=-=-=-=-=-=-=-=-=-=-=-=STOCKS=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
return name;
}
stock SAVE_PATH(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playernam e));
format(string,sizeof(string),SAVE,playername);
return string;
}
stock udb_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
ReturnUser(text[], playerid = INVALID_PLAYER_ID)
{
new pos = 0;
while (text[pos] < 0x21) // Strip out leading spaces
{
if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text
pos++;
}
new userid = INVALID_PLAYER_ID;
if (IsNumeric(text[pos])) // Check whole passed string
{
userid = strval(text[pos]);
if (userid >=0 && userid < MAX_PLAYERS)
{
if(!IsPlayerConnected(userid))
{
userid = INVALID_PLAYER_ID;
}
else
{
return userid;
}
}
}
new len = strlen(text[pos]);
new count = 0;
new name[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i, name, sizeof (name));
if (strcmp(name, text[pos], true, len) == 0)
{ if (len == strlen(name)) { return i;
} else {
count++;
userid = i;
} } } } if (count != 1)
{ if (playerid != INVALID_PLAYER_ID)
{ if (count)
{ SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow earch");
} else { SendClientMessage(playerid, 0xFF0000AA, "No matching user found");}
} userid = INVALID_PLAYER_ID; } return userid;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
stock IsNumeric(str[])
{
new
ch,
i;
while ((ch = str[i++])) if (ch < '0' || ch > '9') return 0;
return 1;
}

And This Is The Error!!

D:\TDM.pwn(1194) : error 021: symbol already defined: "OnPlayerUpdate"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
help me to fix it guys!