22.12.2011, 02:02
(
Last edited by Ivonete; 22/12/2011 at 02:38 PM.
)
pawn Code:
// TOPO:
new Cor[MAX_PLAYERS];
if(!strcmp(cmdtext,"/procurar",true))
{
if(PlayerInfo[playerid][pEmprego] == 1 || IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_GREY,"USO: /procurar [id]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "id invalido.");
GetPlayerPos(0, cX,cX,cX);
Cor[giveplayerid] = GetPlayerColor(giveplayerid);
SetPlayerColor(giveplayerid, 0xFF0000AA);
SetTimerEx("ATT", 1000, false, "ii", playerid, giveplayerid);
return 1;
}
}
// FINAL GM:
forward ATT(playerid, gp);
public ATT(playerid, gp)
{
static Float:x, Float:y, Float:z;
GetPlayerPos(gp, x,y,z);
if(IsPlayerInRangeOfPoint(playerid, 10.0,x,y,z))
{
if(Cor[gp] != 0)
{
SetPlayerColor(gp, Cor[gp]);
Cor[gp] = 0;
}
SendClientMessage(playerid, -1, "ACHOL");
return 0;
}
SetTimerEx("ATT", 1000, false, "ii", playerid, giveplayerid);
return 1;
}