Need help in Gamemode +1Rep
#1

Hello,
I have an CnR Gamemode, and there are many teams, such as the CIA,CIV, Army and Medic teams.
The Problem is that the CIA, CIV, Army and Medic teams are only available if you have an degree which you buyed from the Cityhall.
Now my question is, if somebody can remove this feature so that these 4 Teams are for everyone joinable.

Reward: +1Rep + 8$

Thx,
Reply
#2

Share us the code?

And yeah by the way I dont think a 24 post guy can give a countable rep.
Reply
#3

Quote:
Originally Posted by Maro06
Посмотреть сообщение
Share us the code?

And yeah by the way I dont think a 24 post guy can give a countable rep.
It's a whole Gamemode, I just search for someone who is interested to fix it
Reply
#4

Quote:
Originally Posted by Charalambos26
Посмотреть сообщение
It's a whole Gamemode, I just search for someone who is interested to fix it
You only mentioned a thing to fix, show us the code of OnPlayerRequestClass and OnPlayerRequestSpawn.
Reply
#5

Quote:
Originally Posted by Maro06
Посмотреть сообщение
You only mentioned a thing to fix, show us the code of OnPlayerRequestClass and OnPlayerRequestSpawn.
Код HTML:
public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerNPC(playerid)) return 1;
    SetPlayerTeamFromClass(playerid, classid);
    SetPlayerPos(playerid, 2116.0205, 2143.3225, 10.8203);
    SetPlayerFacingAngle(playerid, 89.6528);
    SetPlayerCameraLookAt(playerid, 2116.0205, 2143.3225, 10.8203);
    SetPlayerCameraPos(playerid, 2116.0205 + (5 * floatsin(-89.6528, degrees)), 2143.3225 + (5 * floatcos(-89.6528, degrees)), 10.8203);
	return 1;
}

Код HTML:
public OnPlayerRequestSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;

    if(IsLoggedIn{playerid} == 0)
	{
		SendClientMessage(playerid, RED, "You MUST be registered and logged in before you can spawn.") && Kick(playerid);
		return 0;
	}
    else if(GetTeam{playerid} == CLASS_COPS && PlayerInfo[playerid][pWanted] >= 1 || GetPlayerWantedLevel(playerid) >= 1)
    {
		SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
      	ForceClassSelection(playerid);
      	return 0;
    }
    else if(GetTeam{playerid} == CLASS_ARMY)
    {
        if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
        {
			if(DegreeInfo[playerid][dDefense] == 1)
    		{
				return 1;
    		}
    		else
    		{
				SendClientMessage(playerid, RED, "This command is restricted to Defense Degree.");
      			GameTextForPlayer(playerid,"~r~Restricted Class", 3000, 5);
      			ForceClassSelection(playerid);
      			return 0;
    		}
    	}
    	else
    	{
			SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
      		ForceClassSelection(playerid);
    	}
      	return 0;
    }
    else if(GetTeam{playerid} == CLASS_CIA || GetTeam{playerid} == CLASS_FBI)
    {
        if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
        {
			if(DegreeInfo[playerid][dLaw] == 1)
    		{
				return 1;
    		}
    		else
    		{
				SendClientMessage(playerid, RED, "This command is restricted to Law Degree.");
      			GameTextForPlayer(playerid,"~r~Restricted Class", 3000, 5);
      			ForceClassSelection(playerid);
      			return 0;
    		}
    	}
    	else
    	{
			SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
      		ForceClassSelection(playerid);
    	}
      	return 0;
    }
    else if(GetTeam{playerid} == CLASS_MEDIC)
    {
        if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
        {
			if(DegreeInfo[playerid][dHealth] == 1)
    		{
				return 1;
    		}
    		else
    		{
				SendClientMessage(playerid, RED, "This command is restricted to Medical Degree.");
      			GameTextForPlayer(playerid,"~r~Restricted Class", 3000, 5);
      			ForceClassSelection(playerid);
      			return 0;
    		}
    	}
    	else
    	{
			SendClientMessage(playerid, RED, "You cant spawn as a Medic while you have Wanted Level.");
      		ForceClassSelection(playerid);
    	}
      	return 0;
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Charalambos26
Посмотреть сообщение
Код HTML:
public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerNPC(playerid)) return 1;
    SetPlayerTeamFromClass(playerid, classid);
    SetPlayerPos(playerid, 2116.0205, 2143.3225, 10.8203);
    SetPlayerFacingAngle(playerid, 89.6528);
    SetPlayerCameraLookAt(playerid, 2116.0205, 2143.3225, 10.8203);
    SetPlayerCameraPos(playerid, 2116.0205 + (5 * floatsin(-89.6528, degrees)), 2143.3225 + (5 * floatcos(-89.6528, degrees)), 10.8203);
	return 1;
}

Код HTML:
public OnPlayerRequestSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;

    if(IsLoggedIn{playerid} == 0)
	{
		SendClientMessage(playerid, RED, "You MUST be registered and logged in before you can spawn.") && Kick(playerid);
		return 0;
	}
    else if(GetTeam{playerid} == CLASS_COPS && PlayerInfo[playerid][pWanted] >= 1 || GetPlayerWantedLevel(playerid) >= 1)
    {
		SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
      	ForceClassSelection(playerid);
      	return 0;
    }
    else if(GetTeam{playerid} == CLASS_ARMY)
    {
        if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
        {
			if(DegreeInfo[playerid][dDefense] == 1)
    		{
				return 1;
    		}
    		else
    		{
				SendClientMessage(playerid, RED, "This command is restricted to Defense Degree.");
      			GameTextForPlayer(playerid,"~r~Restricted Class", 3000, 5);
      			ForceClassSelection(playerid);
      			return 0;
    		}
    	}
    	else
    	{
			SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
      		ForceClassSelection(playerid);
    	}
      	return 0;
    }
    else if(GetTeam{playerid} == CLASS_CIA || GetTeam{playerid} == CLASS_FBI)
    {
        if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
        {
			if(DegreeInfo[playerid][dLaw] == 1)
    		{
				return 1;
    		}
    		else
    		{
				SendClientMessage(playerid, RED, "This command is restricted to Law Degree.");
      			GameTextForPlayer(playerid,"~r~Restricted Class", 3000, 5);
      			ForceClassSelection(playerid);
      			return 0;
    		}
    	}
    	else
    	{
			SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
      		ForceClassSelection(playerid);
    	}
      	return 0;
    }
    else if(GetTeam{playerid} == CLASS_MEDIC)
    {
        if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
        {
			if(DegreeInfo[playerid][dHealth] == 1)
    		{
				return 1;
    		}
    		else
    		{
				SendClientMessage(playerid, RED, "This command is restricted to Medical Degree.");
      			GameTextForPlayer(playerid,"~r~Restricted Class", 3000, 5);
      			ForceClassSelection(playerid);
      			return 0;
    		}
    	}
    	else
    	{
			SendClientMessage(playerid, RED, "You cant spawn as a Medic while you have Wanted Level.");
      		ForceClassSelection(playerid);
    	}
      	return 0;
    }
    return 1;
}
Try
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;

    if(IsLoggedIn{playerid} == 0)
    {
        SendClientMessage(playerid, RED, "You MUST be registered and logged in before you can spawn.") && Kick(playerid);
        return 0;
    }
    else if(GetTeam{playerid} == CLASS_COPS && PlayerInfo[playerid][pWanted] >= 1 || GetPlayerWantedLevel(playerid) >= 1)
    {
        SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
        ForceClassSelection(playerid);
        return 0;
    }
    else if(GetTeam{playerid} == CLASS_ARMY)
    {
        if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
        {
            return 1;
        }
        else
        {
            SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
            ForceClassSelection(playerid);
        }
        return 0;
    }
    else if(GetTeam{playerid} == CLASS_CIA || GetTeam{playerid} == CLASS_FBI)
    {
        if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
        {
            return 1;
        }
        else
        {
            SendClientMessage(playerid, RED, "You cant spawn as Law Enforcement while you have Wanted Level.");
            ForceClassSelection(playerid);
        }
        return 0;
    }
    else if(GetTeam{playerid} == CLASS_MEDIC)
    {
        if(PlayerInfo[playerid][pWanted] < 1 || GetPlayerWantedLevel(playerid) < 1)
        {
            return 1;
        }
        else
        {
            SendClientMessage(playerid, RED, "You cant spawn as a Medic while you have Wanted Level.");
            ForceClassSelection(playerid);
        }
        return 0;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)