26.05.2017, 12:50
(
Последний раз редактировалось ross8839; 26.05.2017 в 14:06.
)
Hi Guys,
I am creating my own Cops n Robbers Gamemode from scratch and I have some pretty complex, advanced stuff in here but apparently the simple stuff caught me off guard and I've tried 100 different things but nothing seems to work.
So I have a variable which defines which faction a player belongs to...
I have checked the users ini file which saves the variables fine every time ... and the PlayerInfo[playerid][pFac] variable is 0 (meaning civ, and shouldn't be able to spawn as police)
Ignore the mess or missing entries etc with nothing in the cases, I am just testing it out at the moment. Then i will complete.
Please could someone just help me out here. I know this is simple, and I've done it before about 4 years ago when i used to script pawn.
Thanks in advance
I am creating my own Cops n Robbers Gamemode from scratch and I have some pretty complex, advanced stuff in here but apparently the simple stuff caught me off guard and I've tried 100 different things but nothing seems to work.
So I have a variable which defines which faction a player belongs to...
pawn Код:
//faction defines
#define FAC_CIV 0
#define FAC_POLICE 1
#define FAC_MAFIA 2
#define FAC_RUS_MAFIA 3
#define FAC_AZTEKAS 4
#define FAC_VAGOS 5
#define FAC_BALLAS 6
pawn Код:
PlayerInfo[playerid][pFac] == FAC_POLICE;
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
//this will set the players faction ID - whether it be 0 for CIV or 1 for Police
switch(classid)
{
case 0..20:
{
PlayerInfo[playerid][pFac] = 0;
GameTextForPlayer(playerid, "~y~CIV", 5000, 5);
SetPlayerPos(playerid,1697.1034,1402.3219,11.3416);
SetPlayerFacingAngle(playerid,304.0754);
SetPlayerCameraPos(playerid,1699.0399,1403.9608,11.4432);
SetPlayerCameraLookAt(playerid,1697.1034,1402.3219,11.3416);
}
case 22..26:
{
GameTextForPlayer(playerid, "~b~CIV", 5000, 5);
}
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
//used to deny certain spawns depending on points
switch(GetPlayerSkin(playerid))
{
case 0..21:
{
SpawnPlayer(playerid);
}
case 22..26:
{
if(PlayerInfo[playerid][pFac] == FAC_POLICE)
{
SpawnPlayer(playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You're not a police officer!");
return 0;
}
}
case 27..30:
{
if(GetPlayerScore(playerid) > 0)
{
SpawnPlayer(playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't high enough level to join that!");
return 0;
}
}
Ignore the mess or missing entries etc with nothing in the cases, I am just testing it out at the moment. Then i will complete.
Please could someone just help me out here. I know this is simple, and I've done it before about 4 years ago when i used to script pawn.
Thanks in advance