11.04.2012, 11:56
Bom estou com uma idea a mesma й simples quero saber como posso criar um timer a cada 10 minutos para o player ir a outra tela, ou seja uma SELEЗГO alguem pode me dar uma idea?
forward ProxTela(playerid); // Topo do GM.
SetTimer("ProxTela", 10000, true); // Onde vocк quer que repita.
public ProxTela(playerid) // Final do GM.
{
ForceClassSelection(playerid);
return 1;
}
Se foi o que entendi...
pawn Код:
pawn Код:
pawn Код:
|
Class[playerid]++;
if(Class[playerid] == 1) {
//setplayerpos(.) setplayercam...
}
if(Class[playerid] == 2) {
}
new Class[MAX_PLAYERS];
pawn Код:
|
#include <a_samp>
#define MAX_CAM (4)// Coloque aqui o mбximo de cвmeras que irб ter.
new
iPlayer[MAX_PLAYERS char],
Float:Locations[MAX_CAM][11] =
{
/* {PlayerPosX, PlayerPosY, PlayerPosZ, CamPosX, CamPosY, CamPosZ, LookPosX, LookPosY, LookPosZ, Angle},*/
{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}
}
;
public OnPlayerRequestClass(playerid, classid)
{
/* Setamos a posiзгo do player */
SetPlayerPos(playerid, Locations[iPlayer{playerid}][0], Locations[iPlayer{playerid}][1], Locations[iPlayer{playerid}][2]);
/* Setamos a posiзгo da cвmera */
SetPlayerCameraPos(playerid, Locations[iPlayer{playerid}][3], Locations[iPlayer{playerid}][4], Locations[iPlayer{playerid}][5]);
/* Setamos a posiзгo da cвmera LookAt */
SetPlayerCameraLookAt(playerid, Locations[iPlayer{playerid}][6],Locations[iPlayer{playerid}][7], Locations[iPlayer{playerid}][8]);
/* E por ъltimo, setamos a posiзгo do Angulo */
SetPlayerFacingAngle(playerid, Locations[iPlayer{playerid}][9]);
return 1;
}
public OnGameModeInit()
{
/* Colocaremos o tempo aqui para chama-lo a cada 10 segundos */
SetTimer("@ProxTela", 10000, true);
return 1;
}
@ProxTela(); public @ProxTela()
{
/* Fazemos um looop para percorrer em todos os players */
for(new i, e = GetMaxPlayers(); i != e; i++){
/* O players tem que estar conectados */
if(IsPlayerConnected(i)){
/* Atribui a array iPlayer + 1 */
iPlayer{i}++;
/* Caso jб estiver no mбximo de cвmeras ele reseta */
if(iPlayer{i} >= MAX_CAM) iPlayer{i} = 0;
/* Manda para seleзгo de classes */
ForceClassSelection(i);
}
}
return 1;
}