Class selection HELP [ REP + ]
#1

Hey guys, I have this:

Код:
new Guard;
then i am determinating the "Guard" into certain AddPlayerClasses, which are guarders skins:

Код:
Guard = AddPlayerClass(163, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	Guard = AddPlayerClass(164, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
And finally, in OnPlayerRequestClass i am checking it, and doing actions:

Код:
	if(classid == Guard && PlayerInfo[playerid][pScore] < 5000)
	{
		SendClientMessage(playerid, COLOR_ORANGE, "[ Server ] You do not have enough points to play guarder!");
		return 0;
	}
But.. the thing is that even if my pScore is 0 i can choose guarder class and also no message showes up, what can be the problem?

Thanks.
Reply
#2

try this code:
Код:
if(classid == Guard && PlayerInfo[playerid][pScore] < 5000)
	{
		SendClientMessage(playerid, COLOR_ORANGE, "[ Server ] You do not have enough points to play guarder!");
		return 1;
	}
Reply
#3

It does not work still.
Reply
#4

Then delete that variable Guard and add that classes without it. Then try this code:
pawn Код:
if((classid == 163 && classid == 164) && PlayerInfo[playerid][pScore] < 5000)
    {
        SendClientMessage(playerid, COLOR_ORANGE, "[ Server ] You do not have enough points to play guarder!");
        return 0;
    }
if this is not working give me whole public OnPlayerRequestClass
Reply
#5

Still aint working.
Reply
#6

can u give me whole OnPlayerRequestClass and OnPlayerRequestSpawn
Reply
#7

What the hell are you talking about bro? This is everything i have in OnPlayerRequestClass.

And I am not using OnPlayerRequestSpawn.
Reply
#8

then try by this way: add new varaible at top:
Код:
new gTeam[MAX_PLAYERS];
new guard1;
new giard2;
ongamemodeinit:
Код:
guard1 = AddPlayerClass(163, 1963.3783, 1342.1572, 16.3746, 269.1425, 0, 0, 0, 0, 0, 0);
guard2 = AddPlayerClass(164, 1963.3783, 1342.1572, 16.3746, 269.1425, 0, 0, 0, 0, 0, 0);
add OnPlayerRequestClass like this:
Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid,classid);
	return 1;
}

SetPlayerTeamFromClass(playerid, classid)
{
 	if(classid == guard1 || classid == guard2)
	{
		gTeam[playerid] = 9;
	}
return 1;
}
then on public OnPlayerRequestSpawn add this:
Код:
public OnPlayerRequestSpawn(playerid)
{
if(gTeam[playerid] == 9)
{
    if(PlayerInfo[playerid][pScore] < 5000)
	{
            SendClientMessage(playerid, COLOR_ORANGE, "[ Server ] You do not have enough points to play guarder!");
            return 0;
	}
}
return 1;
}
Reply
#9

I am already using me pre-defined teams, i do not need to define new ones.

Please, if you can not help, just dont write anything, i want to wait for REAL helper, thanks.
Reply
#10

Quote:
Originally Posted by _GHT_MarK445
Посмотреть сообщение
I am already using me pre-defined teams, i do not need to define new ones.

Please, if you can not help, just dont write anything, i want to wait for REAL helper, thanks.
Ok dude, im sorry for trying to help u, i just give u an example of code witch is working u have it above u can even check it: http://pastebin.com/5rHgNF39
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)