Xp System help !
#1

I was making an Xp system the it's quite worked!
But...
The problem is :
When i have any Xp i can spawn as any class like i have 10 xp and the army needs 20000 xp but i can still spawn as army man!
Код:
public OnPlayerRequestSpawn(playerid)
{
	if(GetPlayerSkin(playerid) == 287)
	{
		if(XP[playerid] <= 20000)
		SpawnPlayer(playerid);
		else
		SendClientMessage(playerid, COLOR_RED, "You need 20000 Xp or more to be an Army Man!");
	}
}
Please help me!
Thanks!
Ironmen
Reply
#2

I've never used this callback before but I think this should work
PHP код:
public OnPlayerRequestSpawn(playerid)
{
    if(
GetPlayerSkin(playerid) == 287)
    {
        if(
XP[playerid] < 20000){ SendClientMessage(playeridCOLOR_RED"You need 20000 Xp or more to be an Army Man!"); }
        
SpawnPlayer(playerid);
    }

Reply
#3

Thanks!
But...
The client message shows that u can't spawn like army and u spawn like an army!
Help me!
Reply
#4

PHP код:
public OnPlayerRequestSpawn(playerid)
{
    if(
GetPlayerSkin(playerid) == 287)
    {
        if(
XP[playerid] < 20000)
       {
       
SendClientMessage(playeridCOLOR_RED"You need 20000 Xp or more to be an Army Man!");
       return 
0;
       }
    
SpawnPlayer(playerid);
    }

Reply
#5

Thanks it worked!
+rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)