SA-MP Forums Archive
Special Class [HELP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Special Class [HELP] (/showthread.php?tid=313036)



Special Class [HELP] - Sting. - 24.01.2012

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?


Re: Special Class [HELP] - Ballu Miaa - 24.01.2012

Steven82 Had the right thing in my view!


Re: Special Class [HELP] - Steven82 - 24.01.2012

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;
}



Re: Special Class [HELP] - Sting. - 24.01.2012

Yup that's it.


Re: Special Class [HELP] - Sting. - 29.04.2012

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".


Re: Special Class [HELP] - tyler12 - 29.04.2012

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


Re: Special Class [HELP] - Sting. - 29.04.2012

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.


Re: Special Class [HELP] - Sting. - 29.04.2012

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?


Re: Special Class [HELP] - tyler12 - 29.04.2012

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..


Re: Special Class [HELP] - Crazymax - 29.04.2012

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;
}