Como verificar o time do player ? -
Lucas-Fc - 17.10.2012
Oi, Como eu posso verificar o time do player, para mandar uma mensagem a ele, quando ele der spawn ?
Exemplo, se o player for do time da PM, quando ele der spawn, vai uma mensбgem da PM...
Se ele for dos aztecas, quando ele der spawn, vai uma mensagem referente a organizaзгo dele entende ?
Tentei fazer assim mais nгo deu certo :
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
switch(classid)
{
case 0:
{
SetPlayerTeam(playerid, TIME_LADRAO);
GameTextForPlayer(playerid, "Ladrao", 2500, 3);
SetPlayerColor(playerid,-1);
SetSpawnInfo(playerid,TIME_LADRAO,115,2324.9663,-1048.3088,52.3516,82.7212,0,0,0,0,0,0);
SendClientMessage(playerid,-1,"Para saber mais informaзхes sobre sua Organizaзгo, Digite /InfoL");
}
Ajuda ai Gatos
Re: Como verificar o time do player ? -
DrTHE - 17.10.2012
GetPlayerTeam
Re: Como verificar o time do player ? -
Lucas-Fc - 17.10.2012
Quote:
Originally Posted by DrTHE
|
Fiz assim :
pawn Код:
public OnPlayerSpawn(playerid)
{
if(GetPlayerTeam(playerid) == TIME_POLICIA)
SendClientMessage(playerid,0x1229FAFF,"Para saber mais informaзхes sobre sua Organizaзгo, Digite {FFFFFF}/InfoPol");
if(GetPlayerTeam(playerid) == TIME_LADRAO)
SendClientMessage(playerid,-1,"Para saber mais informaзхes sobre sua Organizaзгo, Digite /InfoLad");
return 1;
}
Ta certo ?
Re: Como verificar o time do player ? -
MatheusAlcapone - 17.10.2012
mais vocк definiu o id dos times?
Re: Como verificar o time do player ? -
Lucas-Fc - 17.10.2012
Quote:
Originally Posted by matheus_alcapone
mais vocк definiu o id dos times?
|
Sim,
pawn Код:
#define TIME_LADRAO (1)
#define TIME_POLICIA (2)
Re: Como verificar o time do player ? -
MatheusAlcapone - 17.10.2012
entгo ira funcionar!
Re: Como verificar o time do player ? -
Lucas-Fc - 17.10.2012
Funcionou
Vocкs sгo foda xD
Re: Como verificar o time do player ? -
Lucas-Fc - 17.10.2012
Vem cб, eu posso usar essa funзгo tambйm, para restringir um comando ?
Tipo, ao usar um comando de uma organizaзгo diferente da sua, o player receber uma mensagem, tipo :
pawn Код:
"[x] Este comando nгo pertence a sua Organizaзгo "
Tem como ?
Re: Como verificar o time do player ? -
@Riichard - 17.10.2012
if(GetPlayerTeam(playerid) != TIME_POLICIA) return SendClientMessage(playerid, -1, "[x] Este comando nгo pertence a sua Organizaзгo");
Nгo sei como estб seu cуdigo, mas tente.
Re: Como verificar o time do player ? -
Lucas-Fc - 17.10.2012
Quote:
Originally Posted by @Riichard
if(GetPlayerTeam(playerid) != TIME_POLICIA) return SendClientMessage(playerid, -1, "[x] Este comando nгo pertence a sua Organizaзгo");
Nгo sei como estб seu cуdigo, mas tente.
|
Deu Certo, vou testar Aqui InGame
@Edit
Funcionou