help with classes
#1

how to make when someone want to join specific class to require score?
Reply
#2

pawn Код:
if(GetPlayerScore(playerid) >= 100)
{
SendClientMessage(playerid, 0xFF0000AA, "You need at least 100 score to join this team!");
}
else {
//Your code
}
}
Reply
#3

but that only send message and spawns the player
Reply
#4

Make sure you set the team within where it says "your code"
Reply
#5

public OnPlayerRequestClass(playerid, classid)
{
switch (classid) {

case 0:
{
if(GetPlayerScore(playerid) > 100)
{
SendClientMessage(playerid, 0xFF0000AA, "You need over 100 score to join this team!");
}
gTeam[playerid] = TEAM_POLICE; SetPlayerTeam(playerid,1);
SetPlayerColor(playerid,POLICE_COLOUR);
GameTextForPlayer(playerid, "~b~SWAT", 1000, 4);
SetPlayerPos(playerid,220.3261,1822.9734,7.536;//The Place postion
SetPlayerCameraLookAt(playerid,220.3261,1822.9734, 7.536;//Camera Look at the player
SetPlayerCameraPos(playerid,226.7491,1823.0441,7.4 141);//Camera Postiion
SetPlayerFacingAngle(playerid, 270 );//The Facing Angle
}
case 1:
{
//code for other team...

i made this and it isnt working
Reply
#6

pawn Код:
case 0:
{
if(GetPlayerScore(playerid) > 100)
{
SendClientMessage(playerid, 0xFF0000AA, "You need over 100 score to join this team!");
}
else {
gTeam[playerid] = TEAM_POLICE; SetPlayerTeam(playerid,1);
SetPlayerColor(playerid,POLICE_COLOUR);
GameTextForPlayer(playerid, "~b~SWAT", 1000, 4);
SetPlayerPos(playerid,220.3261,1822.9734,7.536;//The Place postion
SetPlayerCameraLookAt(playerid,220.3261,1822.9734, 7.536;//Camera Look at the player
SetPlayerCameraPos(playerid,226.7491,1823.0441,7.4 141);//Camera Postiion
SetPlayerFacingAngle(playerid, 270 );//The Facing Angle
}
}
Try that.
Reply
#7

did you return 0; ?
Reply
#8

not working, spawning without text and anything and not returned 0
Reply
#9

help please!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)