Special Class [HELP]
#1

How do I add a special player class? A one that when the player click's on spawn, a client message say's he must have the score 100 or above. How do I do that? and when the player score is above 100, he click spawn , he spawn. How to do?
Reply
#2

Steven82 Had the right thing in my view!
Reply
#3

Use this coding instead since you don't really have any information specified. But i am guessing it's a CnR or DM/TDM gm. Or use the coding posted above.
pawn Code:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerSkin(playerid) == 1)//the skinid of your special class)
    {
        if(GetPlayerScore(playerid) >= 100)
            return 1;
        else
            SendClientMessage(playerid, COLOR, "Error: You don't have 100 score!");
    }
    return 1;
}
Reply
#4

Yup that's it.
Reply
#5

Because I can't find that "OnPlayerRequestSpawn(playerid), I just added it to the bottom of the script. I have only one error. I'll show it to you.
Code:
C:\Program Files\GtaSan\Rockstar Games\GTA San Andreas\Server 0.3d\gamemodes\*****.pwn(1849) : error 021: symbol already defined: "OnPlayerRequestSpawn"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
How to fix it? There is one, OnPlayerRequestClass, but not "Spawn".
Reply
#6

Quote:
Originally Posted by RTR12
View Post
Because I can't find that "OnPlayerRequestSpawn(playerid), I just added it to the bottom of the script. I have only one error. I'll show it to you.
Code:
C:\Program Files\GtaSan\Rockstar Games\GTA San Andreas\Server 0.3d\gamemodes\*****.pwn(1849) : error 021: symbol already defined: "OnPlayerRequestSpawn"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
How to fix it? There is one, OnPlayerRequestClass, but not "Spawn".
put
PHP Code:
    if(GetPlayerSkin(playerid) == 1)//the skinid of your special class)
    
{
        if(
GetPlayerScore(playerid) >= 100)
            return 
1;
        else
            
SendClientMessage(playeridCOLOR"Error: You don't have 100 score!"); 
on your current OnPlayerRequestClass
Reply
#7

It only shows a message. I want it to be blocked. As if the player can view the class, but when he presses the button "Spawn", he can't. He must have the certain score to spawn.
Reply
#8

I thought I had solve the problem, but no. What I want is that the player can browse and see the skin. But when he click's spawn, the message comes up and he is unable to spawn with that skin. How to do that?
Reply
#9

Quote:
Originally Posted by tyler12
View Post
put
PHP Code:
    if(GetPlayerSkin(playerid) == 1)//the skinid of your special class)
    
{
        if(
GetPlayerScore(playerid) >= 100)
            return 
1;
        else
            
SendClientMessage(playeridCOLOR"Error: You don't have 100 score!"); 
on your current OnPlayerRequestClass
*facePalm* i mean OnPlayerRequestSpawn..
Reply
#10

Try this...

pawn Code:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerSkin(playerid) == 1)//the skinid of your special class)
    {
           if(GetPlayerScore(playerid) < 100) {
                 SendClientMessage(playerid, -1, "Error: You don't have 100 score!");
                 return 0;
           }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)