Class Showing Stop From Spawning
#1

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
Reply
#2

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

thankyou, i just put that under ongamemodeinit ?
Reply
#4

Yes, you can do it under OnGameModeInit
Reply
#5

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.
Reply
#6

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
Reply
#7

That should work
Reply
#8

thankyou and thankyou dimi
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)