HELP settimer doesnt work...
#1

Hi


i'm making intro but SetTimer function doesnt work...

whats worng?


Quote:

forward vaizdas1(playerid);

public OnPlayerSpawn(playerid){

SetPlayerInterior(playerid,0);

//Animaciju uzkrovimas | Visada
PreloadAnimLib(playerid,"ON_LOOKERS");
PreloadAnimLib(playerid,"ped");
PreloadAnimLib(playerid, "BEACH");
PreloadAnimLib(playerid, "benchpress");
PreloadAnimLib(playerid, "CAR");
PreloadAnimLib(playerid, "CAMERA");
PreloadAnimLib(playerid, "COP_AMBIENT");
PreloadAnimLib(playerid, "DODGE");
PreloadAnimLib(playerid, "POLICE");
PreloadAnimLib(playerid, "PARK");
PreloadAnimLib(playerid, "GRAVEYARD");
PreloadAnimLib(playerid, "KISSING");
PreloadAnimLib(playerid, "GANGS");
PreloadAnimLib(playerid, "DAM_JUMP");
PreloadAnimLib(playerid, "MISC");
PreloadAnimLib(playerid, "HEIST9");
PreloadAnimLib(playerid, "PAULNMAC");
PreloadAnimLib(playerid, "VENDING");

//Save ikelimas | Jei zaidejas prisijunge
if(playerDB[playerid][authstate]==2)
{
LoadPlayerData(playerid);
playerDB[playerid][authstate]=4;
SetPlayerColor(playerid,PLAYCOL_HIDDEN);
}else{
if(!playerDB[playerid][uniformd])
{
playerDB[playerid][drabuziai] = GetPlayerSkin(playerid);
playerDB[playerid][lytis] = GetGender(playerDB[playerid][drabuziai]);
}
}
if(playerDB[playerid][specialybe]==21)
{
SetPlayerColor(playerid, COLOR_MEDIUMMAGENTA);
}
if(playerDB[playerid][specialybe]==1)
{
SetPlayerColor(playerid, 0x004E5BFF);
}
if(playerDB[playerid][specialybe]==2)
{
SetPlayerColor(playerid, 0xFF0000FF);
}
if(playerDB[playerid][specialybe]==3)
{
SetPlayerColor(playerid, 0xFBDC04FF);
}
if(playerDB[playerid][specialybe]==20)
{
SetPlayerColor(playerid, 0xFFAC00FF);
}
if(playerDB[playerid][specialybe]==10)
{
SetPlayerColor(playerid, 0x9F9860FF);
}
if(playerDB[playerid][specialybe]==17)
{
SetPlayerColor(playerid, 0x400040FF);
}
if(playerDB[playerid][specialybe]==16)
{
SetPlayerColor(playerid, 0xFFFFFFFF);
}
if(playerDB[playerid][specialybe]==15)
{
SetPlayerColor(playerid, 0x0000A0FF);
}
if(playerDB[playerid][specialybe]==14)
{
SetPlayerColor(playerid, 0xD9E916FF);
}
if(playerDB[playerid][specialybe]==11)
{
SetPlayerColor(playerid, 0x000000FF);
}
if(playerDB[playerid][specialybe]==12)
{
SetPlayerColor(playerid, 0xD9E916FF);
}
if(playerDB[playerid][specialybe]==9)
{
SetPlayerColor(playerid, 0xD9E916FF);
}
if(playerDB[playerid][specialybe]==7)
{
SetPlayerColor(playerid, 0x004000FF);
}
if(playerDB[playerid][specialybe]==24)
{
SetPlayerColor(playerid, LAKUNO_SPALVA);
}
if(playerDB[playerid][specialybe]==23)
{
SetPlayerColor(playerid, ADVOKATO_SPALVA);
}
if(playerDB[playerid][specialybe]==30)
{
SetPlayerColor(playerid, DRAUDIMAS_SPALVA);
}
if(playerDB[playerid][specialybe]==29)
{
SetPlayerColor(playerid, DRAUDIMAS_SPALVA);
}
if(playerDB[playerid][specialybe]==2
{
SetPlayerColor(playerid, COLOR_RED);
}
if(playerDB[playerid][specialybe]==27)
{
SetPlayerColor(playerid, FILMU_SPALVA);
}
if(playerDB[playerid][specialybe]==26)
{
SetPlayerColor(playerid, KUNIGO_SPALVA);
}
if(playerDB[playerid][specialybe]==25)
{
SetPlayerColor(playerid, TURTO_SPALVA);
}
if(playerDB[playerid][specialybe]==31)
{
SetPlayerColor(playerid, JURININKO_SPALVA);
}
if(playerDB[playerid][specialybe]==50)
{
SetPlayerColor(playerid, COLOR_GOLD);
}
if(playerDB[playerid][specialybe]==51)
{
SetPlayerColor(playerid, 0x0000BBAA);
}




//Zinute ir pradiniai pinigai | Jei zaidejas ka tik uzsiregistravo
if(playerDB[playerid][authstate]==1)
{
SetTimer("vaizdas1",10000,false);
SendClientMessage(playerid,COLOR_CORAL,"* Bandom ar veikia intro, turi rodyt sita vaizda 10 sek...!");
SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0);
SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);
GivePlayerMoneyA(playerid,1000);
SetPlayerScore(playerid, 0);
playerDB[playerid][drabuziai] = GetPlayerSkin(playerid);
SetPlayerWeather(playerid, 2);
}



//Givybes ir lytis | Jei zaidejas jau buvo prisijunges arba uzsiregistravo
if(playerDB[playerid][authstate]!=2)
{
SetPlayerHealth(playerid,100);
}

//Spalva ir patvirtinimas | Jei zaidejas ka tik uzsiregistravo ar prisijunge
if(playerDB[playerid][authstate] <2)
{
SetPlayerColor(playerid,PLAYCOL_HIDDEN);
playerDB[playerid][authstate]=3;
}

//Jei zaidejas mire kalejime arba paliko zaidima budamas ten, jis grizta
if (playerDB[playerid][ikalintas])
{
SetPlayerInterior(playerid,10);
SetPlayerPos(playerid,227.3138,108.9786,999.0156);
}

PlayerPlaySound(playerid,1185+1,0,0,0);
return 1;
}



public vaizdas1(playerid)
{
SendClientMessage(playerid,COLOR_CORAL,"* Veikia, darom viska toliau...!");
SetPlayerCameraPos(playerid, 3200.0, 500.0, 1700.0);
SetPlayerCameraLookAt(playerid, 3240.34, 540.122, 1730.35);
}

Reply
#2

vaizdas1 expects a parameter (playerid).

SetTimer is to call a function without parameters.

You need SetTimerEx:

https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#3

thank's now working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)