Stopping a player spawn if they don't meet requirement -
acade - 08.01.2013
Hey, I've basically got a PlayerInfo[playerid][Clan] system, So for example, Clan = 1, Able to spawn as PD.
How would I implament it if I was set to clan 0, went to choose PD and not allowed to spawn as I am not in Clan 1?
Код:
if(PlayerInfo[playerid][Clan] != 1)
{
return 0;
}
I basically have this, Do I place it under public OnPlayerRequestClass pr OnPlayerSpawn?
Re: Stopping a player spawn if they don't meet requirement -
mastermax7777 - 08.01.2013
onplayerrequestspawn
Re: Stopping a player spawn if they don't meet requirement -
acade - 09.01.2013
I seem to confuse myself,
Код:
public OnPlayerRequestSpawn(playerid)
{
if(PlayerInfo[playerid][Clan] != 1)
{
return 0;
}
return 1;
}
forward SetPlayerTeamFromClass(playerid, classid);
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
{
if(classid == 0)
{
gTeam[playerid] = TEAM_US;
SetPlayerPos(playerid,2500.6060,-1672.1453,13.3512);
SetPlayerCameraPos(playerid,2507.0615,-1674.3574,13.3732);
SetPlayerCameraLookAt(playerid,2500.6060,-1672.1453,13.3512);
SetPlayerFacingAngle(playerid,252.4717);
GameTextForPlayer(playerid, "~b~American's", 3000, 5);
SetPlayerColor(playerid, BLUE);
return 1;
}
else if(classid == 1)
{
gTeam[playerid] = TEAM_RUS;
SetPlayerPos(playerid,2500.6060,-1672.1453,13.3512);
SetPlayerCameraPos(playerid,2507.0615,-1674.3574,13.3732);
SetPlayerCameraLookAt(playerid,2500.6060,-1672.1453,13.3512);
SetPlayerFacingAngle(playerid,252.4717);
GameTextForPlayer(playerid, "~r~Russian's", 3000, 5);
SetPlayerColor(playerid, RED);
return 1;
}
}
return 1;
}
Trying to stop anyone not in clan 1 spawning as gTeam[playerid] = TEAM_US;
Re: Stopping a player spawn if they don't meet requirement -
DaRk_RaiN - 09.01.2013
pawn Код:
forward SetPlayerTeamFromClass(playerid, classid);
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
{
if(classid == 0 && PlayerInfo[playerid][Clan] == 1)
{
gTeam[playerid] = TEAM_US;
SetPlayerPos(playerid,2500.6060,-1672.1453,13.3512);
SetPlayerCameraPos(playerid,2507.0615,-1674.3574,13.3732);
SetPlayerCameraLookAt(playerid,2500.6060,-1672.1453,13.3512);
SetPlayerFacingAngle(playerid,252.4717);
GameTextForPlayer(playerid, "~b~American's", 3000, 5);
SetPlayerColor(playerid, BLUE);
return 1;
}
else if(classid == 1)
{
gTeam[playerid] = TEAM_RUS;
SetPlayerPos(playerid,2500.6060,-1672.1453,13.3512);
SetPlayerCameraPos(playerid,2507.0615,-1674.3574,13.3732);
SetPlayerCameraLookAt(playerid,2500.6060,-1672.1453,13.3512);
SetPlayerFacingAngle(playerid,252.4717);
GameTextForPlayer(playerid, "~r~Russian's", 3000, 5);
SetPlayerColor(playerid, RED);
return 1;
}
}
return 1;
}
Re: Stopping a player spawn if they don't meet requirement -
Ryan McDuff - 09.01.2013
I believe it has something to do with "onplayerrequestspawn".