OnPlayerRequestSpawn just not working :S ???
#1

I want players only to be about to spawn it thay have 100+ score for this one class:

Код:
public OnPlayerRequestSpawn(playerid)
{

    if(gTeam[playerid] == CLASS_MERC || GetPlayerScore(playerid) < 100){SendClientMessage(playerid, RED, "[ATT]:You Must Have Atleast 100 Score To Be A Mercenary Class!");
	}
    return 1;
}
Ive tried so many ways its just not working :S

Any help?
Reply
#2

You must return 0 in order to refuse the player to spawn, and return 1 to make him spawn
Reply
#3

do it under
OnPlayerRequestClass(playerid, classid){
Reply
#4

pawn Код:
public OnPlayerRequestSpawn(playerid)
{

    if(gTeam[playerid] == CLASS_MERC || GetPlayerScore(playerid) < 100){SendClientMessage(playerid, RED, "[ATT]:You Must Have Atleast 100 Score To Be A Mercenary Class!");
    }
    return 1;
    }
    return 0;
}
I just tryed it in my script and it worked ok
Reply
#5

Quote:
Originally Posted by [MG]Trotty
Посмотреть сообщение
pawn Код:
public OnPlayerRequestSpawn(playerid)
{

    if(gTeam[playerid] == CLASS_MERC || GetPlayerScore(playerid) < 100){SendClientMessage(playerid, RED, "[ATT]:You Must Have Atleast 100 Score To Be A Mercenary Class!");
    }
    return 1;
    }
    return 0;
}
I just tryed it in my script and it worked ok
I think it didn't, you had the brackets wrong and the returns at the opposite places

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
  if(gTeam[playerid] == CLASS_MERC && GetPlayerScore(playerid) < 100)
  {
    SendClientMessage(playerid, RED, "[ATT]:You Must Have Atleast 100 Score To Be A Mercenary Class!");
    return 0;
  }
  return 1;
}
Reply
#6

hehe sorry i got a error once i added another bit of script to it so you were right

BTW love the Cowly Cow FS of yours
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)