SA-MP Forums Archive
Check score for skin select? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Check score for skin select? (/showthread.php?tid=266392)



Check score for skin select? - ServerScripter - 04.07.2011

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


Re: Check score for skin select? - RyDeR` - 04.07.2011

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



Re: Check score for skin select? - Jochemd - 04.07.2011

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


Re : Check score for skin select? - ServerScripter - 04.07.2011

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


Re: Check score for skin select? - RelaxCafe - 04.07.2011

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


Re : Re: Re : Check score for skin select? - ServerScripter - 05.07.2011

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?


Re: Check score for skin select? - Gazmull - 05.07.2011

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


Re: Check score for skin select? - FireCat - 05.07.2011

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!");



Re : Check score for skin select? - ServerScripter - 05.07.2011

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!");