Check score for skin select?
#1

Hello, now, i need whene a player choose a skin, it says: you need 350kills to get in this skin or something
Please Help
1/ write me the script code
2/ tell me where i add it.
thunx
Reply
#2

pawn Code:
if(GetPlayerScore(playerid) >= 350)
{
    // Set skin
}
else SendClientMessage(playerid, -1, "You need at least 350 score for this skin!");
Reply
#3

Add this in OnPlayerRequestSpawn while you set a variable for player to classid in OnPlayerRequestClass
Reply
#4

But, i need that for the two skins: 285+ 287 , i need the code check the score of the player , if he has 350 he cans choose it, and if he hasn't it says : You need at least 350 score for this skin!
thunx
Reply
#5

Code:
new skin[40][500];//for 40 different skins..
public OnPlayerRequestClass(playerid, classid)
{
  switch(classid)
		{

			case 0://this is the first skin placed on gamemodeinit, such as addplayerclass ...you count them and number the cases.. starting with 0 with the 1st one..
			{
                         if(GetPlayerScore(playerid) < 350)GameTextForPlayer(playerid, "~n~ ~n~ ~r~Not available.", 999999, 3);
                         skin[0][playerid] = 1;//this is for case 0, as you see [0] ...
                         }
                         case 1:
                         {

                          } 
                 }
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
 if(skin[0][playerid] == 1 && GetPlayerScore(playerid) < 350)
{
SendClientMessage(playerid,RED, "You must have at least 350 score before choosing this skin.");
return 0;
 }
return 1;
}
}
Well this is my way..
Reply
#6

Quote:
Originally Posted by ******
View Post
So you would just add two skins using "Class_AddForGroup" instead of one.
ok so , whoose code a choose?
where i put the cod?
Can you give me an example for add Skin?
Reply
#7

******' y_classes is good, would you give a try?
Reply
#8

I'd jsut do
pawn Code:
if(GetPlayerSkin(playerid) == skinid && GetPlayerScore(playerid) < (less) 350) return SendClientMessage(playerid,color,"You need at least 350 of score to use this skin!");
Reply
#9

FireCat, whene i add this cod?
Code:
if(GetPlayerSkin(playerid) == skinid && GetPlayerScore(playerid) < (less) 350) return SendClientMessage(playerid,color,"You need at least 350 of score to use this skin!");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)