29.10.2013, 15:26
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/camaras", true))
{
if(!IsPlayerInRangeOfPoint(playerid, 6.0, 1918.5892, -1771.2928, 18.3735)) return SendClientMessage(playerid, -1, #No estбs en la zona de cбmaras);
if(JugEnCamara[playerid] == 0)
{
TimerCamaras(playerid);
TimerCamara[playerid] = SetTimerEx("TimerCamaras", TIEMPO_SEG*1000, 1, "i", playerid);
JugEnCamara[playerid] = 1;
NumCamara[playerid] = 0;
SendClientMessage(playerid, -1, #* Has comenzado a ver la camara de seguridad.);
TogglePlayerControllable(playerid, 0);
return 1;
}
else if(JugEnCamara[playerid] == 1)
{
KillTimer(TimerCamara[playerid]);
JugEnCamara[playerid] = 0;
NumCamara[playerid] = 0;
CamaraFijada[playerid] = 0;
SendClientMessage(playerid, -1, #* Has dejado de ver la camara de seguridad.);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 1);
}
return 1;
}
return 0;
}