SA-MP Forums Archive
Class Showing Stop From Spawning - 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: Class Showing Stop From Spawning (/showthread.php?tid=282529)



Class Showing Stop From Spawning - [LHT]Bally - 11.09.2011

right say if i want to have a class showing but not be able to use it , how i do this with game text saying this class isnt finished.

i set classes up like this

pawn Код:
AddPlayerClassEx(5, 29,1046.0646,1305.6222,11.0412,346.2078,0,0,0,0,0,0); // Team ID 5 == Cabbie
    AddPlayerClassEx(5, 25,1046.0646,1305.6222,11.0412,346.2078,0,0,0,0,0,0); //
so basically if a player goes to pick it when they click spawn it says sorry this class cant be used


Re: Class Showing Stop From Spawning - Pinguinn - 11.09.2011

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 5) return SendClientMessage(playerid, 0xFFFFFF, "That skin/class is not allowed!");
    return 1;
}



Re: Class Showing Stop From Spawning - [LHT]Bally - 11.09.2011

thankyou, i just put that under ongamemodeinit ?


Re: Class Showing Stop From Spawning - Pinguinn - 11.09.2011

Yes, you can do it under OnGameModeInit


Re: Class Showing Stop From Spawning - [MG]Dimi - 11.09.2011

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
     if(
classid == [your class idyou will get it by counting1st added class is id 1second 2 etc.])
     {
          
GameTextForPlayer(playerid,"This class isn't finished yet!",3000,6);
          return 
0;
     }
     return 
1;

EDIT: @Pinguin
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    if(
classid == 5) return SendClientMessage(playerid0xFFFFFF"That skin/class is not allowed!");
    return 
1;

Will fail. You don't have code to prevent player from spawning and you added teamid instead of classid.


Re: Class Showing Stop From Spawning - [LHT]Bally - 11.09.2011

public OnPlayerRequestClass(playerid, classid)
{
if(classid == 5) return GameTextForPlayer(playerid, "~r~THIS CLASS IS NOT FINISHED YET", 2000, 3);
return 1;
} <<-- will that work instead of sendclientmessage


Re: Class Showing Stop From Spawning - Pinguinn - 11.09.2011

That should work


Re: Class Showing Stop From Spawning - [LHT]Bally - 11.09.2011

thankyou and thankyou dimi


Re: Class Showing Stop From Spawning - [LHT]Bally - 11.09.2011

got 1 last thing tho that no1 can solve , new threead tho


Re: Class Showing Stop From Spawning - [MG]Dimi - 11.09.2011

No problem. Just dont make mistake... Teamid, which you use isn't same as classid.