login system failure
#9

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;
}
Reply


Messages In This Thread
login system failure - by adithegman - 24.06.2013, 14:09
Re: login system failure - by Sasoft - 24.06.2013, 14:22
Re: login system failure - by adithegman - 24.06.2013, 14:31
Re: login system failure - by introzen - 24.06.2013, 14:44
Re: login system failure - by adithegman - 24.06.2013, 14:51
Re: login system failure - by introzen - 24.06.2013, 14:52
Re: login system failure - by adithegman - 24.06.2013, 14:57
Re: login system failure - by introzen - 24.06.2013, 15:00
Re: login system failure - by adithegman - 24.06.2013, 15:05

Forum Jump:


Users browsing this thread: 2 Guest(s)