SA-MP Forums Archive
login system failure - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: login system failure (/showthread.php?tid=446106)



login system failure - adithegman - 24.06.2013

then i'm trying to compile it gives me some errors all pointing to line 163. The line 163 is blank... but somethimes it points to this: (my login system)

Код:
public OnPlayerDisconnect(playerid, reason)
{
	new INI:File = INI_Open(UserPath(playerid));
	INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
	INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
	INI_WriteInt(File,"Wanted",PlayerInfo[playerid][pWanted]);
	INI_WriteInt(File,"Faction",PlayerInfo[playerid][pFaction]);
	INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
	INI_WriteInt(File,"Leader",PlayerInfo[playerid][pLeader]);
	INI_WriteInt(File,"FWarns",PlayerInfo[playerid][pFWarns]);
	INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
	INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
	INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
	INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
	INI_Close(File);
	PlayerInfo[playerid][pLogged] = 0;
	KillTimer(OnPlayerUpdateExTimer[playerid]);
	godcar[playerid] = false;
	return 1;
}
errors:
Код:
C:\Users\ema\Desktop\Server\pawno\include\YSI\y_utils.inc(163) : error 017: undefined symbol "strlen"
C:\Users\ema\Desktop\Server\pawno\include\YSI\y_utils.inc(163) : warning 217: loose indentation
C:\Users\ema\Desktop\Server\pawno\include\YSI\y_utils.inc(163) : warning 215: expression has no effect
C:\Users\ema\Desktop\Server\pawno\include\YSI\y_utils.inc(163) : error 001: expected token: ";", but found ")"
C:\Users\ema\Desktop\Server\pawno\include\YSI\y_utils.inc(163) : error 029: invalid expression, assumed zero
C:\Users\ema\Desktop\Server\pawno\include\YSI\y_utils.inc(163) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: login system failure - Sasoft - 24.06.2013

What's on line 162?


Re: login system failure - adithegman - 24.06.2013

nothing it's blank, that's the strange thing


Re: login system failure - introzen - 24.06.2013

post the nearest line with code which is above 163.


Re: login system failure - adithegman - 24.06.2013

Код:
// Includes
#include <YSI\y_ini>
#include <YSI\y_utils>
#include <streamer>
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <core>
#include <datagram>
#include <foreach>

enum pInfo
{
    pPass,
    pLogged,
    pCash,
    pAdmin,
    pWanted,
    pFaction,
    pRank,
    pLeader,
    pFWarns,
	pSkin,
    pKills,
    pDeaths,
    pBanned
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new hitman;
new CopOnDuty[MAX_PLAYERS];
new OnPlayerUpdateExTimer[MAX_PLAYERS];
new bool:godcar[MAX_PLAYERS];

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Romanian Free Server");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
} // --> this is the line 163



Re: login system failure - introzen - 24.06.2013

Post code BELOW 163 aswell please.


Re: login system failure - adithegman - 24.06.2013

Код:
#else

main()
{
	print("\n----------------------------------");
	print(" Romanian Free Server");
	print("----------------------------------\n");
}

#endif

new lspddoor1,lspddoor2,lspddoor3,lspddoor4,lspdgate1,lspdgate2;

public OnGameModeInit()
{
	SetGameModeText("RomanianFreeServer");
	UsePlayerPedAnims();
	AllowInteriorWeapons(1);
	ShowPlayerMarkers(0);
	ShowNameTags(1);
	DisableInteriorEnterExits();
	SetNameTagDrawDistance(20.0);
	EnableStuntBonusForAll(0);
    hitman = GangZoneCreate(-2711.423, 499.3826, -1996.826, 1087.182);
	CreateDynamicMapIcon(1553.8164,-1675.7432,16.1953,30,-1,-1,-1,-1,300.0);

	// LSPD
    CreateObject(1491,225.10000610,115.90000153,1002.20001221,0.00000000,0.00000000,0.00000000); //object(gen_doorint01) (1)
	CreateObject(1491,220.30000305,116.00000000,1002.20001221,0.00000000,0.00000000,0.00000000); //object(gen_doorint01) (2)
	CreateObject(1491,223.30000305,116.00000000,1002.20001221,0.00000000,0.00000000,180.00000000); //object(gen_doorint01) (3)
	CreateObject(1649,242.00000000,119.40000153,1005.09997559,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (1)
	CreateObject(1649,246.39999390,119.40000153,1005.09997559,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (2)
	CreateObject(1649,250.80000305,119.40000153,1005.09997559,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (4)
	lspddoor1 = CreateObject(1536,239.50000000,119.09999847,1002.20001221,0.00000000,0.00000000,270.49987793); //object(gen_doorext15) (1)
	lspddoor2 = CreateObject(1536,239.60000610,116.09999847,1002.20001221,0.00000000,0.00000000,90.49438477); //object(gen_doorext15) (2)
	lspddoor3 = CreateObject(1536,253.19999695,110.59999847,1002.20001221,0.00000000,0.00000000,270.49987793); //object(gen_doorext15) (1)
	lspddoor4 = CreateObject(1536,253.19999695,107.59999847,1002.20001221,0.00000000,0.00000000,88.49438477); //object(gen_doorext15) (2)
	CreateObject(2886,239.80000305,116.19999695,1003.70001221,0.00000000,0.00000000,92.00000000); //object(sec_keypad) (1)
	CreateObject(2886,253.00000000,110.40000153,1003.70001221,0.00000000,0.00000000,267.99951172); //object(sec_keypad) (2)
	CreateObject(2886,239.30000305,118.90000153,1003.70001221,0.00000000,0.00000000,267.99951172); //object(sec_keypad) (1)
	CreateObject(2886,253.39999390,107.69999695,1003.70001221,0.00000000,0.00000000,91.99499512); //object(sec_keypad) (2)
	CreatePickup(1247,1,1554.2738,-1675.5295,16.1953,0);
	CreatePickup(1318,1,246.4012,107.2995,1003.2188,0);
	CreateObject(3109,213.60000610,126.40000153,1003.29998779,0.00000000,0.00000000,180.00000000); //object(imy_la_door) (1)
	CreateObject(3109,217.50000000,125.09999847,1003.29998779,0.00000000,0.00000000,359.99450684); //object(imy_la_door) (2)
	CreatePickup(1318,1,214.0999,125.7107,1003.2188,0); // Way to Garage
	CreatePickup(1318,1,217.0594,125.8019,1003.2188,0); // Way to roof
	CreatePickup(1318,1,1552.5898,-1677.9690,6.2188,0); // Garage
	CreatePickup(1318,1,1524.4833,-1677.8240,6.2188,0); // Garage to roof
	CreatePickup(1318,1,1571.8706,-1675.5492,28.3955,0); // Roof
	CreatePickup(1318,1,1558.0908,-1675.5249,28.3955,0); // Roof to garage
	CreateObject(1653,246.50000000,119.30000305,1004.20001221,0.00000000,0.00000000,0.00000000); //object(fencehaitism) (1)
	CreateObject(1653,246.50000000,119.30000305,1005.59997559,0.00000000,0.00000000,0.00000000); //object(fencehaitism) (2)
	CreateObject(1704,243.39999390,124.50000000,1002.20001221,0.00000000,0.00000000,0.00000000); //object(kb_chair03) (1)
	CreateObject(1704,249.10000610,124.50000000,1002.20001221,0.00000000,0.00000000,0.00000000); //object(kb_chair03) (2)
	CreateObject(2190,243.80000305,122.90000153,1003.09997559,0.00000000,0.00000000,170.00000000); //object(pc_1) (1)
	CreateObject(2190,249.30000305,122.80000305,1003.09997559,0.00000000,0.00000000,169.99694824); //object(pc_1) (2)
	CreateObject(14604,252.39999390,121.09999847,1003.20001221,0.00000000,0.00000000,88.00000000); //object(tv_stand_bike) (1)
	CreateObject(2700,249.00000000,119.59999847,1006.59997559,0.00000000,30.00000000,88.00000000); //object(cj_sex_tv2) (1)
	CreateObject(2700,246.80000305,119.69999695,1006.59997559,0.00000000,29.99816895,87.99499512); //object(cj_sex_tv2) (2)
	CreateObject(2700,244.60000610,119.80000305,1006.59997559,0.00000000,29.99816895,87.99499512); //object(cj_sex_tv2) (3)
	CreateObject(2572,262.70001221,108.40000153,1003.70001221,0.00000000,0.00000000,100.00000000); //object(hotel_single_2) (1)
	CreateObject(2315,267.70001221,110.09999847,1003.59997559,0.00000000,0.00000000,270.00000000); //object(cj_tv_table4) (1)
	CreateObject(1748,267.89999390,109.19999695,1004.09997559,0.00000000,0.00000000,266.00000000); //object(low_tv_3) (1)
	CreateObject(1657,245.60000610,111.80000305,1010.50000000,0.00000000,0.00000000,0.00000000); //object(htl_fan_rotate_nt) (1)
	CreateObject(990,1543.50000000,-1638.30004883,14.10000038,0.00000000,0.00000000,89.25000000); //object(bar_barrier12) (1)
	CreateObject(992,1544.50000000,-1622.80004883,14.10000038,0.00000000,0.00000000,86.00000000); //object(bar_barrier10b) (1)
	CreateObject(992,1544.69995117,-1619.50000000,14.10000038,0.00000000,0.00000000,85.99548340); //object(bar_barrier10b) (2)
	CreateObject(992,1543.59997559,-1633.90002441,14.10000038,0.00000000,0.00000000,89.99548340); //object(bar_barrier10b) (3)
	lspdgate1 = CreateObject(976,1544.09997559,-1623.50000000,12.39999962,0.00000000,0.00000000,266.75000000); //object(phils_compnd_gate) (1)
	lspdgate2 = CreateObject(980,1586.69995117,-1638.19995117,15.10000038,0.00000000,0.00000000,0.00000000); //object(airportgate) (1)
	CreatePickup(1318,1,1583.5065,-1638.2456,13.3543,0);
	CreatePickup(1318,1,1544.0807,-1624.8009,13.3828,0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
 	SpawnPlayer(playerid);
}

public OnPlayerConnect(playerid)
{
	if(fexist(UserPath(playerid)))
	{
		INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login","Type your password below to login.","Login","Quit");
	}
	else
	{
		ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Registering...","Type your password below to register a new account.","Register","Quit");
	}
	SetTimer("CurrentTime",1,true);
	TogglePlayerClock(playerid,1);
	OnPlayerUpdateExTimer[playerid] = SetTimerEx("OnPlayerUpdateEx", 1000, true, "i", playerid);
	godcar[playerid] = false;
	if(PlayerInfo[playerid][pFaction] == 0) return SetPlayerColor(playerid,COLOR_WHITE);
	if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1) return SetPlayerColor(playerid,0x1464F4); // 0x00B2EE, 0x1464F4, origin 0x0000FFFF
	if(PlayerInfo[playerid][pFaction] == 0)
	{
        SetSpawnInfo(playerid,0,PlayerInfo[playerid][pSkin],1309.9510,-1368.3278,13.5474,184.3216,0,0,0,0,0,0);
  	}
	if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
	{
        SetSpawnInfo(playerid,0,PlayerInfo[playerid][pSkin],228.6125,110.3943,1003.2188,90.0000,41,500,0,0,0,0);
        SetPlayerInterior(playerid,10);
		SetPlayerFacingAngle(playerid,356.5215);
	}
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	new INI:File = INI_Open(UserPath(playerid));
	INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
	INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
	INI_WriteInt(File,"Wanted",PlayerInfo[playerid][pWanted]);
	INI_WriteInt(File,"Faction",PlayerInfo[playerid][pFaction]);
	INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
	INI_WriteInt(File,"Leader",PlayerInfo[playerid][pLeader]);
	INI_WriteInt(File,"FWarns",PlayerInfo[playerid][pFWarns]);
	INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
	INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
	INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
	INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
	INI_Close(File);
	PlayerInfo[playerid][pLogged] = 0;
	KillTimer(OnPlayerUpdateExTimer[playerid]);
	godcar[playerid] = false;
	return 1;
}

public OnPlayerSpawn(playerid)
{
	GangZoneShowForPlayer(playerid, hitman, 0xFF000096);
	SetPlayerWantedLevel(playerid,PlayerInfo[playerid][pWanted]);
	if(PlayerInfo[playerid][pFaction] == 0) return SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
	if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1) return SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	PlayerInfo[killerid][pKills]++;
	PlayerInfo[playerid][pDeaths]++;
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
    if(PlayerInfo[playerid][pLogged] == 0)
	{
 		SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai.");
 		return 0;
	}
	new message[128];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
    format(message, sizeof(message), "%s says: %s", name, text);
    ProxDetector(playerid, 20.0, message, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	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)
{
	if(GetPlayerMoney(playerid) < PlayerInfo[playerid][pCash] || GetPlayerMoney(playerid) > PlayerInfo[playerid][pCash])
	{
		ResetPlayerMoney(playerid);
		GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
        new string[128],Name[MAX_PLAYER_NAME];
      	GetPlayerName(playerid,Name,sizeof(Name));
		format(string,sizeof(string),"(AmdWarn) %s(%d) este suspectat de Money Hacking.",Name,playerid);
		SendMessageToAdmins(COLOR_LIGHTRED,string);
	}
	new armedweapon = GetPlayerWeapon(playerid);
	new Name[MAX_PLAYER_NAME],string[128];
	GetPlayerName(playerid,Name,sizeof(Name));
	if(armedweapon == 38)
	{
		if(PlayerInfo[playerid][pAdmin] < 1)
		{
		 	format(string,sizeof(string),"AdmCmd: %s was banned by the server, Reason: Minigun Cheats",Name);
		 	SendClientMessageToAll(COLOR_LIGHTRED,string);
		 	PlayerInfo[playerid][pBanned] = 1;
			BanEx(playerid,"Minigun Cheats");
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,1.0,1554.2738,-1675.5295,16.1953))
	{
 		SetPlayerPos(playerid,246.4668,109.3327,1003.2187);
 		SetPlayerFacingAngle(playerid,356.5215);
 		SetPlayerInterior(playerid,10);
	}
	if(IsPlayerInRangeOfPoint(playerid,1.0,246.4012,107.2995,1003.2188))
	{
 		SetPlayerPos(playerid,1552.8113,-1675.3368,16.1953);
 		SetPlayerFacingAngle(playerid,84.6264);
 		SetPlayerInterior(playerid,0);
	}
	// PD Roof to Garage, Gara to roof etc
	if(IsPlayerInRangeOfPoint(playerid,1.0,214.0999,125.7107,1003.2188))  // Garage Spawn from inside
	{
	    if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
	    {
	 		SetPlayerPos(playerid,1554.3206,-1677.9681,6.2188);
	 		SetPlayerFacingAngle(playerid,271.3980);
	 		SetPlayerInterior(playerid,0);
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,1.0,217.0594,125.8019,1003.2188))  // Roof Spawn From Inside
	{
	    if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
	    {
	 		SetPlayerPos(playerid,1574.0359,-1675.4767,28.3955);
	 		SetPlayerFacingAngle(playerid,267.5743);
	 		SetPlayerInterior(playerid,0);
 		}
	}
	if(IsPlayerInRangeOfPoint(playerid,1.0,1552.5898,-1677.9690,6.2188)) // Inside Spawn
	{
		if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
		{
	 		SetPlayerPos(playerid,215.3482,124.8738,1003.2188);
	 		SetPlayerFacingAngle(playerid,183.1419);
	 		SetPlayerInterior(playerid,10);
 		}
	}
	if(IsPlayerInRangeOfPoint(playerid,1.0,1571.8706,-1675.5492,28.3955)) // Inside Spawn
	{
        if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
        {
			SetPlayerPos(playerid,215.3482,124.8738,1003.2188);
	 		SetPlayerFacingAngle(playerid,183.1419);
	 		SetPlayerInterior(playerid,10);
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,1.0,1558.0908,-1675.5249,28.3955)) // Garage Spawn from roof
	{
        if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
        {
	 		SetPlayerPos(playerid,1526.3611,-1677.8269,5.8906);
	 		SetPlayerFacingAngle(playerid,263.0423);
	 		SetPlayerInterior(playerid,0);
 		}
	}
	if(IsPlayerInRangeOfPoint(playerid,1.0,1524.4833,-1677.8240,6.2188))  // Roof Spawn From Garage
	{
        if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
        {
			SetPlayerPos(playerid,1556.2576,-1675.4427,28.3955);
	 		SetPlayerFacingAngle(playerid,89.8313);
	 		SetPlayerInterior(playerid,0);
 		}
	}
	new Keys,ud,lr;
	if(IsPlayerInRangeOfPoint(playerid,0.8,240.2464,116.2381,1003.2257))
	{
		if(GetPlayerKeys(playerid,Keys,ud,lr))
		{
			if(Keys == 16)
			{
				if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
				{
					SetPlayerPos(playerid,240.4884,116.2737,1003.2257);
					SetPlayerFacingAngle(playerid,92.0886);
					ApplyAnimation(playerid,"HEIST9","Use_SwipeCard",4.0,0,0,0,0,0);
					MoveObject(lspddoor1,239.50000000,120.09999847,1002.20001221,6.0);
					MoveObject(lspddoor2,239.60000610,114.90000153,1002.20001221,6.0);
					SetTimer("CloseLSPDDoor1",3000,false);
				}
			}
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,0.8,252.5480,110.3099,1003.2188))
	{
		if(GetPlayerKeys(playerid,Keys,ud,lr))
		{
			if(Keys == 16)
			{
                if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
                {
					SetPlayerPos(playerid,252.3218,110.4384,1003.2188);
					SetPlayerFacingAngle(playerid,266.5125);
					ApplyAnimation(playerid,"HEIST9","Use_SwipeCard",4.0,0,0,0,0,0);
					MoveObject(lspddoor3,253.19999695,111.59999847,1002.20001221,6.0);
					MoveObject(lspddoor4,253.19999695,106.50000000,1002.20001221,6.0);
					SetTimer("CloseLSPDDoor2",3000,false);
				}
			}
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,0.8,238.1922,118.3208,1003.2188))
	{
		if(GetPlayerKeys(playerid,Keys,ud,lr))
		{
			if(Keys == 16)
			{
			    if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
			    {
					SetPlayerPos(playerid,238.6642,118.7351,1003.2188);
					SetPlayerFacingAngle(playerid,268.0794);
					ApplyAnimation(playerid,"HEIST9","Use_SwipeCard",4.0,0,0,0,0,0);
					MoveObject(lspddoor1,239.50000000,120.09999847,1002.20001221,6.0);
					MoveObject(lspddoor2,239.60000610,114.90000153,1002.20001221,6.0);
					SetTimer("CloseLSPDDoor1",3000,false);
				}
			}
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,0.8,254.2835,108.2115,1003.2257))
	{
		if(GetPlayerKeys(playerid,Keys,ud,lr))
		{
			if(Keys == 16)
			{
			    if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
			    {
					SetPlayerPos(playerid,254.1906,107.7826,1003.2257);
					SetPlayerFacingAngle(playerid,96.4522);
					ApplyAnimation(playerid,"HEIST9","Use_SwipeCard",4.0,0,0,0,0,0);
					MoveObject(lspddoor3,253.19999695,111.59999847,1002.20001221,6.0);
					MoveObject(lspddoor4,253.19999695,106.50000000,1002.20001221,6.0);
					SetTimer("CloseLSPDDoor2",3000,false);
				}
			}
		}
	}
	// LSPD Gates
	if(IsPlayerInRangeOfPoint(playerid,3.0,1540.7709,-1627.4595,13.3828)) // LSPDgate1
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			if(GetPlayerKeys(playerid,Keys,ud,lr))
			{
				if(Keys == 2)
				{
				    if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
				    {
						MoveObject(lspdgate1,1544.09997559,-1632.50000000,12.39999962,4.0);
						SetTimer("CloseLSPDGate1",3000,false);
					}
				}
			}
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,3.0,1547.2313,-1627.9692,13.3828)) // LSPDgate1
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			if(GetPlayerKeys(playerid,Keys,ud,lr))
			{
				if(Keys == 2)
				{
				    if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
				    {
						MoveObject(lspdgate1,1544.09997559,-1632.50000000,12.39999962,4.0);
						SetTimer("CloseLSPDGate1",3000,false);
					}
				}
			}
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,3.0,1588.4768,-1634.8383,13.3828)) // LSPDgate2
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			if(GetPlayerKeys(playerid,Keys,ud,lr))
			{
				if(Keys == 2)
				{
				    if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
				    {
						MoveObject(lspdgate2,1586.69995117,-1638.19995117,20.39999962,4.0);
						SetTimer("CloseLSPDGate2",3000,false);
					}
				}
			}
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,3.0,1588.9160,-1642.4055,12.7758)) // LSPDgate2
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			if(GetPlayerKeys(playerid,Keys,ud,lr))
			{
				if(Keys == 2)
				{
				    if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
				    {
						MoveObject(lspdgate2,1586.69995117,-1638.19995117,20.39999962,4.0);
						SetTimer("CloseLSPDGate2",3000,false);
					}
				}
			}
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,1.5,1544.0807,-1624.8009,13.3828)) // LSPDgate1
	{
		if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
		{
			MoveObject(lspdgate1,1544.09997559,-1632.50000000,12.39999962,4.0);
			SetTimer("CloseLSPDGate1",3000,false);
		}
	}
	if(IsPlayerInRangeOfPoint(playerid,1.5,1583.5065,-1638.2456,13.3543)) // LSPDgate2
	{
		if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
		{
			MoveObject(lspdgate2,1586.69995117,-1638.19995117,20.39999962,4.0);
			SetTimer("CloseLSPDGate2",3000,false);
		}
	}
	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");
                new INI:File = INI_Open(UserPath(playerid));
                new Name[MAX_PLAYER_NAME],string[128];
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Logged",0);
                INI_WriteInt(File,"Cash",3000);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Wanted",0);
                INI_WriteInt(File,"Faction",0);
                INI_WriteInt(File,"Rank",0);
                INI_WriteInt(File,"Leader",0);
                INI_WriteInt(File,"FWarns",0);
                INI_WriteInt(File,"Skin",250);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Banned",0);
                INI_Close(File);
	            SetTimer("Spawn",1,false);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"Success!","Great! You are now registered!","Ok","");
				GetPlayerName(playerid,Name,sizeof(Name));
				format(string,sizeof(string),"%s has registered.",Name);
				print(string);
				format(string,sizeof(string),"Welcome %s",Name);
				SendClientMessage(playerid,COLOR_WHITE,string);
                PlayerInfo[playerid][pLogged] = 1;
                a_SpawnPlayer(playerid);
                if(PlayerInfo[playerid][pAdmin] > 0)
                {
                    format(string,sizeof(string),"SERVER: You are logged in as Level %d Admin.",PlayerInfo[playerid][pAdmin]);
                    SendClientMessage(playerid,COLOR_WHITE,string);
				}
			}
        }
        case DIALOG_LOGIN:
        {
            if(!response) return Kick(playerid );
            if(response)
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
					INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
					if(PlayerInfo[playerid][pBanned] == 1)
					{
					    GameTextForPlayer(playerid,"~w~This account is ~r~banned",20000,1);
					    Kick(playerid);
					}
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
					ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"Success!","You have successfully logged in!","Ok","");
					new Name[MAX_PLAYER_NAME],string[128];
					GetPlayerName(playerid,Name,sizeof(Name));
					format(string,sizeof(string),"%s has logged in.",Name);
					print(string);
					format(string,sizeof(string),"Welcome %s",Name);
					SendClientMessage(playerid,COLOR_WHITE,string);
					PlayerInfo[playerid][pLogged] = 1;
					a_SpawnPlayer(playerid);
     				if(PlayerInfo[playerid][pAdmin] > 0)
                	{
                 		format(string,sizeof(string),"SERVER: You are logged in as Level %d Admin.",PlayerInfo[playerid][pAdmin]);
	                    SendClientMessage(playerid,COLOR_WHITE,string);
					}
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                }
                return 1;
			}
			return 1;
        }
    }
    if(dialogid==DIALOG_VEHICLES && response==1)
    {
	 new Float:x,Float:y,Float:z,car;
	 switch(listitem)
	 {
	  case 0:
	  {
	   GetPlayerPos(playerid,x,y,z);
	   car = CreateVehicle(411,x-3.0,y,z,0.0,1,1,300);
	   PutPlayerInVehicle(playerid,car,0);
	   new Name[MAX_PLAYER_NAME];
	   GetPlayerName(playerid,Name,sizeof(Name));
	   SetVehicleNumberPlate(car,Name);
	  }
	  case 1:
	  {
	   GetPlayerPos(playerid,x,y,z);
	   car = CreateVehicle(451,x-3.0,y,z,0.0,1,3,300);
	   PutPlayerInVehicle(playerid,car,0);
	   new Name[MAX_PLAYER_NAME];
	   GetPlayerName(playerid,Name,sizeof(Name));
	   SetVehicleNumberPlate(car,Name);
	  }
	  case 2:
	  {
	   GetPlayerPos(playerid,x,y,z);
	   car = CreateVehicle(429,x-3.0,y,z,0.0,1,0,300);
	   PutPlayerInVehicle(playerid,car,0);
	   new Name[MAX_PLAYER_NAME];
	   GetPlayerName(playerid,Name,sizeof(Name));
	   SetVehicleNumberPlate(car,Name);
	  }
	  case 3:
	  {
	   GetPlayerPos(playerid,x,y,z);
	   car = CreateVehicle(592,x-3.0,y,z,0.0,0,1,300);
	   PutPlayerInVehicle(playerid,car,0);
	   new Name[MAX_PLAYER_NAME];
	   GetPlayerName(playerid,Name,sizeof(Name));
	   SetVehicleNumberPlate(car,Name);
	  }
	  case 4:
	  {
	   GetPlayerPos(playerid,x,y,z);
	   car = CreateVehicle(562,x-3.0,y,z,0.0,1,1,300);
	   PutPlayerInVehicle(playerid,car,0);
	   new Name[MAX_PLAYER_NAME];
	   GetPlayerName(playerid,Name,sizeof(Name));
	   SetVehicleNumberPlate(car,Name);
	  }
	 }
	}
    return 1;
}

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

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
	INI_Int("Password",PlayerInfo[playerid][pPass]);
	INI_Int("Cash",PlayerInfo[playerid][pCash]);
	INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
	INI_Int("Wanted",PlayerInfo[playerid][pWanted]);
	INI_Int("Faction",PlayerInfo[playerid][pFaction]);
	INI_Int("Rank",PlayerInfo[playerid][pRank]);
	INI_Int("Leader",PlayerInfo[playerid][pLeader]);
	INI_Int("FWarns",PlayerInfo[playerid][pFWarns]);
	INI_Int("Skin",PlayerInfo[playerid][pSkin]);
	INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Banned",PlayerInfo[playerid][pBanned]);
 	return 1;
}

forward OnPlayerUpdateEx(playerid);
public OnPlayerUpdateEx(playerid)
{
	if(IsPlayerInAnyVehicle(playerid))
	{
	    if(godcar[playerid] == true)
	    {
	        RepairVehicle(GetPlayerVehicleID(playerid));
	        SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
	    }
	}
}

forward CloseLSPDDoor1();
public CloseLSPDDoor1()
{
	MoveObject(lspddoor1,239.50000000,119.09999847,1002.20001221,6.0);
	MoveObject(lspddoor2,239.60000610,116.09999847,1002.20001221,6.0);
}

forward CloseLSPDDoor2();
public CloseLSPDDoor2()
{
	MoveObject(lspddoor3,253.19999695,110.59999847,1002.20001221,6.0);
	MoveObject(lspddoor4,253.19999695,107.59999847,1002.20001221,6.0);
}

forward CloseLSPDGate1();
public CloseLSPDGate1()
{
    MoveObject(lspdgate1,1544.09997559,-1623.50000000,12.39999962,4.0);
}

forward CloseLSPDGate2();
public CloseLSPDGate2()
{
    MoveObject(lspdgate2,1586.69995117,-1638.19995117,15.10000038,4.0);
}

forward CurrentTime(playerid);
public CurrentTime(playerid)
{
	new h,m,s;
	gettime(h,m,s);
	SetPlayerTime(playerid,h,m);
}

stock a_SpawnPlayer(playerid)
{
	if(PlayerInfo[playerid][pFaction] == 0)
	{
        SetSpawnInfo(playerid,0,PlayerInfo[playerid][pSkin],1309.9510,-1368.3278,13.5474,184.3216,0,0,0,0,0,0);
		SpawnPlayer(playerid);
  	}
	if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
	{
        SetSpawnInfo(playerid,0,PlayerInfo[playerid][pSkin],228.6125,110.3943,1003.2188,90.0000,41,500,0,0,0,0);
        SetPlayerInterior(playerid,10);
		SpawnPlayer(playerid);
		SetPlayerFacingAngle(playerid,356.5215);
	}
}

stock SendMessageToAdmins(color,msg[])
{
	foreach(new i : Player)
	{
		if(PlayerInfo[i][pAdmin] > 0)
		{
			SendClientMessage(i,color,msg);
			print(msg);
		}
	}
}

stock a_GivePlayerMoney(playerid, money)
{
    PlayerInfo[playerid][pCash] += money;
    GivePlayerMoney(playerid, money);
}

stock UserPath(playerid)
{
	new string[128],playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid,playername,sizeof(playername));
	format(string,sizeof(string),PATH,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;
}

stock ProxDetector(playerid, Float:radius, string[], col1, col2, col3, col4, col5)
{
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
	new Float:ix, Float:iy, Float:iz;
	new Float:cx, Float:cy, Float:cz;
	foreach(Player, i)
	{
	        if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
	        {
				GetPlayerPos(i, ix, iy, iz);
				cx = (x - ix);
				cy = (y - iy);
				cz = (z - iz);
				if(((cx < radius/16) && (cx > -radius/16)) && ((cy < radius/16) && (cy > -radius/16)) && ((cz < radius/16) && (cz > -radius/16)))
				{
				    SendClientMessage(i, col1, string);
				}
				else if(((cx < radius/8) && (cx > -radius/8)) && ((cy < radius/8) && (cy > -radius/8)) && ((cz < radius/8) && (cz > -radius/8)))
				{
				    SendClientMessage(i, col2, string);
				}
				else if(((cx < radius/4) && (cx > -radius/4)) && ((cy < radius/4) && (cy > -radius/4)) && ((cz < radius/4) && (cz > -radius/4)))
				{
				    SendClientMessage(i, col3, string);
				}
				else if(((cx < radius/2) && (cx > -radius/2)) && ((cy < radius/2) && (cy > -radius/2)) && ((cz < radius/2) && (cz > -radius/2)))
				{
				    SendClientMessage(i, col4, string);
				}
				else if(((cx < radius) && (cx > -radius)) && ((cy < radius) && (cy > -radius)) && ((cz < radius) && (cz > -radius)))
				{
				    SendClientMessage(i, col5, string);
				}
			}
	}
	return 1;
}



Re: login system failure - introzen - 24.06.2013

What was the last thing in the code that you changed/coded?


Re: login system failure - adithegman - 24.06.2013

i think some commands, i didn't post them... these are the last cmmds i made:

Код:
CMD:myfaction(playerid,params[])
{
	if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai.");
	if(PlayerInfo[playerid][pFaction] == FAC_CIVIL) return SendClientMessage(playerid,COLOR_WHITE,"You are a Civilian!");
	if(PlayerInfo[playerid][pFaction] == FAC_PD) return SendClientMessage(playerid,COLOR_WHITE,"You are a LSPD Officer!");
	return 1;
}

CMD:duty(playerid,params[])
{
	if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
	{
        if(IsPlayerInRangeOfPoint(playerid,100.0,246.1186,113.7773,1003.2188))
        {
			if(CopOnDuty[playerid] == 0)
			{
				if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai.");
				GivePlayerWeapon(playerid,3,1);
				GivePlayerWeapon(playerid,24,500);
				GivePlayerWeapon(playerid,29,500);
				GivePlayerWeapon(playerid,25,300);
				GivePlayerWeapon(playerid,41,1500);
				CopOnDuty[playerid] = 1;
				new Name[MAX_PLAYER_NAME],string[128];
				GetPlayerName(playerid,Name,sizeof(Name));
				format(string, sizeof(string), "* Officer %s takes a Badge and a Gun from his locker.", Name);
        		ProxDetector(playerid, 20.0, string, 0x61E659FF, 0x61E659FF, 0x61E659FF, 0x61E659FF, 0x61E659FF);
			}
			else if(CopOnDuty[playerid] == 1)
			{
                if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai.");
				ResetPlayerWeapons(playerid);
			    GivePlayerWeapon(playerid,41,500);
			    CopOnDuty[playerid] = 0;
		    	new Name[MAX_PLAYER_NAME],string[128];
				GetPlayerName(playerid,Name,sizeof(Name));
				format(string, sizeof(string), "* Officer %s places a Badge and a Gun from his locker.", Name);
        		ProxDetector(playerid, 20.0, string, 0x61E659FF, 0x61E659FF, 0x61E659FF, 0x61E659FF, 0x61E659FF);
			}
		}
		else
		{
		    SendClientMessage(playerid,COLOR_WHITE,"You are not in PD/FBI/NG or in a house!");
		}
	}
	else
	{
	    SendClientMessage(playerid,COLOR_WHITE,"You are not a COP/FBI Agent/NG!");
	}
	return 1;
}

CMD:makeleader(playerid,params[])
{
	if(PlayerInfo[playerid][pAdmin] > 5)
	{
	    if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai.");
		new id,factionid;
		if(sscanf(params,"ui",id,factionid)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /makeleader [playerid] [factionid]");
		if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Doesn't Exist");
	    if(PlayerInfo[id][pFaction] > 0) return SendClientMessage(playerid,COLOR_WHITE,"That player is already in a faction!");
	    if(factionid < 0 || factionid > 1) return SendClientMessage(playerid,COLOR_WHITE,"Invalid factionid!");
		new AdminName[MAX_PLAYER_NAME],Name[MAX_PLAYER_NAME],string[128];
		GetPlayerName(playerid,AdminName,sizeof(AdminName));
		GetPlayerName(playerid,Name,sizeof(Name));
		switch(factionid)
		{
		    case FAC_CIVIL:
		    {
		        format(string,sizeof(string),"(AdmChat) %s taked %s's leader and now he is a Civilian Again.",AdminName,Name);
		        SendMessageToAdmins(COLOR_YELLOW,string);
		        SendClientMessage(playerid,COLOR_YELLOW,"Your Leader has been taken and now you are a Civilian again.");
		        SetPlayerSkin(id,250);
		        PlayerInfo[playerid][pLeader] = 0;
			}
			case FAC_PD:
			{
			    format(string,sizeof(string),"(AdmChat) %s gived %s the control of PD.",AdminName,Name);
       			SendMessageToAdmins(COLOR_YELLOW,string);
                format(string,sizeof(string),"%s has given you the control of the PD.",AdminName);
       			SendClientMessage(playerid,COLOR_YELLOW,string);
       			SetPlayerSkin(id,265);
		        PlayerInfo[playerid][pLeader] = 1;
			}
		}
	}
	else
	{
		SendClientMessage(playerid,COLOR_WHITE,"*** Nu esti autorizat pentru a folosi aceasta comanda.");
		return 1;

	}
	return 1;
}

CMD:suspect(playerid,params[])
{
	if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
	{
		if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai.");
		if(CopOnDuty[playerid] == 0) return SendClientMessage(playerid,COLOR_WHITE,"You are not on Duty!");
		new id,wantedlevel,crime[128],string[128];
		new CopName[MAX_PLAYER_NAME],SuspectName[MAX_PLAYER_NAME];
		if(sscanf(params,"uus[128]",id,wantedlevel,crime)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: (/su)spect [playerid] [1-6] [crime]");
		if(playerid == id) return SendClientMessage(playerid,COLOR_WHITE,"You cannot suspect yourself!");
		if(PlayerInfo[id][pFaction] == 1 || PlayerInfo[id][pLeader] == 1) return SendClientMessage(playerid,COLOR_WHITE,"You cannot give wanted to a Cop!");
		if(wantedlevel <= PlayerInfo[id][pWanted]) return SendClientMessage(playerid,COLOR_WHITE,"That player is already a suspect!");
		if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Doesn't Exist");
        SetPlayerWantedLevel(id,wantedlevel);
		PlayerInfo[id][pWanted] = wantedlevel;
		GetPlayerName(playerid,CopName,sizeof(CopName));
		GetPlayerName(id,SuspectName,sizeof(SuspectName));
		format(string,sizeof(string),"You have comited a crime: %s Reporter: %s Wanted: %d",crime,CopName,wantedlevel);
		SendClientMessage(id,COLOR_YELLOW,string);
		foreach(new i:Player)
		{
			if(PlayerInfo[i][pFaction] == 1 || PlayerInfo[i][pLeader] == 1)
			{
 	 			format(string,sizeof(string),"Suspect: {FF0000}%s {0000FF}Crime: {FF0000}%s {0000FF}Wanted: {FF0000}%d {0000FF}Reporter: {FF0000}%s",SuspectName,crime,wantedlevel,CopName);
                SendClientMessage(i,0x0000FFFF,"HQ: All Units, Crime Report:");
			 	SendClientMessage(i,0x0000FFFF,string);
				print("(PD/FBI/NG Chat) HQ: All Units, Crime Report:");
				print(string);
			}
		}
	}
 	else
	{
	    SendClientMessage(playerid,COLOR_WHITE,"You are not a COP/FBI Agent/NG!");
	}
	return 1;
}

CMD:su(playerid,params[]) return cmd_suspect(playerid,params);

CMD:giverank(playerid,params[])
{
	if(PlayerInfo[playerid][pLeader] > 0)
	{
	    if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai.");
	    new id,rank,Name[MAX_PLAYER_NAME],string[128];
	    if(sscanf(params,"uu",id,rank)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /giverank [playerid] [rank 1-5]");
	    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Doesn't Exist");
	    if(rank < 1 || rank > 5) return SendClientMessage(playerid,-1,"Invalid Rank!");
	    if(PlayerInfo[playerid][pLeader] != PlayerInfo[id][pFaction]) return SendClientMessage(playerid,-1,"That player is not in your faction!");
	    if(PlayerInfo[id][pRank] == rank) return SendClientMessage(playerid,-1,"That player already has that rank!");
	    if(playerid == id) return SendClientMessage(playerid,-1,"You cannot give yourself a rank!");
	    PlayerInfo[id][pRank] = rank;
	    GetPlayerName(id,Name,sizeof(Name));
	    format(string,sizeof(string),"You gave %s rank %d.",Name,rank);
		SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
		if(rank < PlayerInfo[id][pRank])
		{
			format(string,sizeof(string),"You have been demoted to rank %d by the Leader.",rank);
	  		SendClientMessage(id,COLOR_LIGHTBLUE,string);
		}
		else if(rank > PlayerInfo[id][pRank])
  		{
    		format(string,sizeof(string),"You have been promoted to rank %d by the Leader.",rank);
      		SendClientMessage(id,COLOR_LIGHTBLUE,string);
		}
	}
 	else
	{
	    SendClientMessage(playerid,COLOR_WHITE,"You are not a Leader!");
	}
	return 1;
}

CMD:invite(playerid,params[])
{
	if(PlayerInfo[playerid][pLeader] > 0)
	{
	    if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai.");
	    new id,Name[MAX_PLAYER_NAME],LeaderName[MAX_PLAYER_NAME],string[128];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /invite [playerid]");
	    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Doesn't Exist");
	    if(PlayerInfo[id][pFaction] > 0 || PlayerInfo[id][pLeader] > 0) return SendClientMessage(playerid,-1,"That player id already in a faction!");
	    if(playerid == id) return SendClientMessage(playerid,-1,"You cannot invite yourself!");
	    if(PlayerInfo[id][pWanted] > 0) return SendClientMessage(playerid,-1,"That player is wanted");
	    GetPlayerName(id,Name,sizeof(Name));
	    GetPlayerName(playerid,LeaderName,sizeof(LeaderName));
	    format(string,sizeof(string),"You invited %s to join your faction.",Name);
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	    format(string,sizeof(string),"You have been invited by %s to join his faction.",LeaderName);
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
		PlayerInfo[id][pFaction] = PlayerInfo[playerid][pLeader];
		PlayerInfo[id][pRank] = 1;
		SpawnPlayer(playerid);
	}
	else
	{
	    SendClientMessage(playerid,COLOR_WHITE,"You are not a Leader!");
	}
	return 1;
}

CMD:uninvite(playerid,params[])
{
	if(PlayerInfo[playerid][pLeader] > 0)
	{
	    if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai.");
	    new id,Name[MAX_PLAYER_NAME],string[128];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /uninvite [playerid]");
	    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Doesn't Exist");
	    if(PlayerInfo[id][pFaction] > 0 || PlayerInfo[id][pLeader] > 0) return SendClientMessage(playerid,-1,"That player is already in a faction!");
	    if(playerid == id) return SendClientMessage(playerid,-1,"You cannot invite yourself!");
	    GetPlayerName(id,Name,sizeof(Name));
	    format(string,sizeof(string),"You have uninvited %s.",Name);
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have been kicked from the family. [By The Leader/Police Force]");
		PlayerInfo[id][pFaction] = 0;
		PlayerInfo[id][pRank] = 0;
		SetPlayerSkin(playerid,250);
		PlayerInfo[id][pSkin] = 250;
		SpawnPlayer(playerid);
	}
	else
	{
	    SendClientMessage(playerid,COLOR_WHITE,"You are not a Leader!");
	}
	return 1;
}