13.04.2013, 11:38
Hi All. I need help with repeating timer. I have timer for Login but now when player death again show me a Login dialog why ? Codes:
Help me please :/ !! Rep ++
pawn Код:
OnPlayerConnect:
logintimer = SetTimerEx("TimerZaLogin", 7000, false, "i", playerid); // LOGIN TIMER
pawn Код:
public OnPlayerRequestClass(playerid)
{
//-----------------
PlayerPlaySound(playerid, 1067, 0.0, 0.0, 0.0);
TogglePlayerSpectating(playerid, 1);
new RandomStart;
RandomStart = random(2);
switch(RandomStart)
{
case 0:
{
InterpolateCameraPos(playerid, 1167.263549, -953.536621, 44.003799, 1238.583618, -933.317016, 41.953529, 10000, 1);
InterpolateCameraLookAt(playerid, 1168.216918, -953.339111, 43.775718, 1242.507446, -932.542785, 41.891162, 10000, 1);
PlayerInfo[playerid][pInt] = 0;
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1134.3859,-910.9868,62.9894);
}
case 1:
{
InterpolateCameraPos(playerid, 1291.788452, -807.976135, 88.962501, 1248.348632, -804.083923, 98.385025, 10000, 1);
InterpolateCameraLookAt(playerid, 1291.308471, -808.819519, 89.203948, 1244.513427, -803.718261, 99.460784, 10000, 1);
PlayerInfo[playerid][pInt] = 0;
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1134.3859,-910.9868,62.9894);
}
}
}
pawn Код:
forward TimerZaLogin(playerid, classid);
public TimerZaLogin(playerid, classid)
{
//-----------------
if(RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
{
if(gPlayerAccount[playerid] != 0)
{
new loginstring[800];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring, sizeof(loginstring), "{FFFFFF}Dobrodojdovte Gospodine %s\n{0080FF}>{FFFFFF}Vasiot akaunt e registriran i e uspesno vcitan zatoa ve molime\nvnesete ja vasata lozinka za da se logirate na vasiot akaunt\n\n", loginname);
strcat(loginstring, "{0080FF}>{FFFFFF}Otkako ke se logirate ne zaboravajte na RP Pravilata\nkoj treba da gi pocituvate vo sprotivno ke sleduvaat\nkazni od Admin/GM timot sto e nadlezen zatoa\n\n");
strcat(loginstring, "{0080FF}>{FFFFFF}DreamCast Gaming vi posakuva mnogu zabava i druzenje\n");
strcat(loginstring, "{0080FF}>{FFFFFF}Dokolku imate nekoj problem posetete {FFFF00}www.dc-game.tk");
ShowPlayerDialog(playerid, 12346,DIALOG_STYLE_PASSWORD,"{FF4242}Logiranje",loginstring,"Ok","Izlez");
}
else
{
new regstring[800];
format(regstring, sizeof(regstring), "{FFFFFF}Dobrodojdovte na DreamCast RPG Macedonia\n{0080FF}>{FFFFFF}Pred da zapocnete so igranje potrebno e da go registrirate vasiot akaunt.\n\n");
strcat(regstring, "{0080FF}>{FFFFFF}Za uspesna registracija ke treba da odgovorite na prasanjata koj ke vi bidat postaveni i se vo vrska so Role Play\npravilata koj treba da gi pocituvate pri igranje");
strcat(regstring, "{FFFFFF}za taa cel uspesno sledete go tutorialot koj ke vi bide prikazan");
strcat(regstring, "\n\n{0080FF}>{FFFFFF}DreamCast Gaming vi posakuva mnogu zabava i druzenje\n{0080FF}>{FFFFFF}Dokolku imate nekoj problem posetete {FFFF00}www.dc-game.tk");
ShowPlayerDialog(playerid, DIALOG_REGISTRACIJA1, DIALOG_STYLE_MSGBOX, "{FF4242}Registracija",regstring,"Ok","Izlez");
}
PlayerPlaySound(playerid, 1187, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pModel] = Peds[classid][0];
SetPlayerTeamFromClass(playerid,classid);
KillTimer(logintimer);
}
else SpawnPlayer(playerid); { KillTimer(logintimer); }
return false;
}