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(playerid, classid)
{
if(classid == [your class id, you will get it by counting, 1st added class is id 1, second 2 etc.])
{
GameTextForPlayer(playerid,"This class isn't finished yet!",3000,6);
return 0;
}
return 1;
}
EDIT: @Pinguin
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
if(classid == 5) return SendClientMessage(playerid, 0xFFFFFF, "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.