SA-MP Forums Archive
Only spawn when you have level 6 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: Only spawn when you have level 6 HELP (/showthread.php?tid=566476)



Only spawn when you have level 6 HELP - Fantje - 06.03.2015

Hi, I need a script that you can only spawn ( in this case admin class ) if you have level 6.

Help


Re: Only spawn when you have level 6 HELP - finelaq - 06.03.2015

Quote:
Originally Posted by Fantje
Посмотреть сообщение
Hi, I need a script that you can only spawn ( in this case admin class ) if you have level 6.

Help
Check if he has level 6 and if not then send message like "You have to be level 6".


Re: Only spawn when you have level 6 HELP - bigboy81 - 06.03.2015

Код:
				if(PlayerInfo[playerid][pLevel] > 6)
				{
                                        SafeSetPlayerPos(playerid, Float:x, Float:y, Float:z);
				}
                                else
                                {
                                        SendClientMessage(playerid, COLOR_GRAD1, "You must be level 6 to spawn");
                                        return 1;
                                }



Re: Only spawn when you have level 6 HELP - Fantje - 06.03.2015

I need the script for if he hasn't level 6 you can't spawn


Re: Only spawn when you have level 6 HELP - Fantje - 06.03.2015

Thanks


Re: Only spawn when you have level 6 HELP - Fantje - 06.03.2015

ERRORS


Re: Only spawn when you have level 6 HELP - bigboy81 - 06.03.2015

Quote:
Originally Posted by Fantje
Посмотреть сообщение
ERRORS
Код:
	if(PlayerInfo[playerid][pLevel] > 6)
				{
                                        SafeSetPlayerPos(playerid, Float:x, Float:y, Float:z);
				}
                                else
                                {
                                        SendClientMessage(playerid, COLOR_GRAD1, "You must be level 6 to spawn");
                                        return 1;
                                }
That is example..
SafeSetPlayerPos must be first defined to this work..
Try put SetPlayerPos it will work


Re: Only spawn when you have level 6 HELP - Fantje - 06.03.2015

PHP код:
C:\Users\Administrator\Desktop\SvT Mike\gamemodes\C_VS_T_4.1.pwn(1372) : error 017undefined symbol "PlayerInfo"
C:\Users\Administrator\Desktop\SvT Mike\gamemodes\C_VS_T_4.1.pwn(1372) : warning 215expression has no effect
C
:\Users\Administrator\Desktop\SvT Mike\gamemodes\C_VS_T_4.1.pwn(1372) : error 001expected token";"but found "]"
C:\Users\Administrator\Desktop\SvT Mike\gamemodes\C_VS_T_4.1.pwn(1372) : error 029invalid expressionassumed zero
C
:\Users\Administrator\Desktop\SvT Mike\gamemodes\C_VS_T_4.1.pwn(1372) : fatal error 107too many error messages on one line 
My class lines:

PHP код:
public OnPlayerRequestClass(playeridclassid){
   
SetSkinToMeSkin[playerid]=500;
   new 
skin=GetPlayerSkin(playerid);
   switch(
skin){
      case 
125,124:{
        
SetPlayerPos(playerid, -382.5999,2206.6169,42.4236);
        
SetPlayerFacingAngle(playerid,280.0);
        if(
Options[TextLanguage]==2)GameTextForPlayer(playerid,"~r~TERRORISTS",2000,3);
        
SetPlayerColor(playerid,COLOR_LIGHTRED);SKIN[playerid]=skin;
        
SetPlayerCameraPos(playerid, -379.5999,2206.6169,42.4236);
        
SetPlayerCameraLookAt(playerid, -382.5999,2206.6169,42.4236);}
      case 
287:{
        
SetPlayerPos(playerid212.7791,1919.7570,17.6406);
        
SetPlayerFacingAngle(playerid,180.0);
        if(
Options[TextLanguage]==2)GameTextForPlayer(playerid,"~b~SWAT",2000,3);
        
SetPlayerColor(playerid,COLOR_BLUE);SKIN[playerid]=skin;
        
SetPlayerCameraPos(playerid212.7791,1916.7570,17.6406);
        
SetPlayerCameraLookAt(playerid212.7791,1919.7570,17.6406);}
      case 
285:{
        
SetPlayerPos(playerid212.7791,1919.7570,17.6406);
        
SetPlayerFacingAngle(playerid,180.0);
        if(
Options[TextLanguage]==2)GameTextForPlayer(playerid,"~b~DONATOR",2000,3);
        
SetPlayerColor(playerid,COLOR_BLUE);SKIN[playerid]=skin;
        
SetPlayerCameraPos(playerid212.7791,1916.7570,17.6406);
        
SetPlayerCameraLookAt(playerid212.7791,1919.7570,17.6406);}}
   return 
1;} 



Re: Only spawn when you have level 6 HELP - bigboy81 - 06.03.2015

Do you have variable of player level,if you have it send me because i don't know how you are defined it.


Re: Only spawn when you have level 6 HELP - Fantje - 06.03.2015

I used this:

PHP код:
if(PlayerInfo[playerid][pLevel] > 6)
                {
                                        
SafeSetPlayerPos(playeridFloat:xFloat:yFloat:z);
                }
                                else
                                {
                                        
SendClientMessage(playeridCOLOR_GRAD1"You must be level 6 to spawn");
                                        return 
1;
                                } 
I don't have the variable I think... I am noob so I don't know