PDA

View Full Version : Tutorial question


MarinacMrcina
17/06/2012, 07:07 PM
I made a tutorial for my RP server and now I have a problem;when I connect the tutorial starts and finishes then I start playing and my friend connects and he doesn't see the tutorial but the tutorial starts for me again.
Can you tell me what i did wrong?I can post any script part that would help solving the problem.
Thanks!

ViniBorn
17/06/2012, 07:19 PM
Is the tutorial in OnPlayerConnect ?

MarinacMrcina
17/06/2012, 07:30 PM
Nope,here is the tutorial code.I used public funcions and timers.


public OnPlayerConnect(playerid)
{
TogglePlayerControllable(playerid,0);
TogglePlayerSpectating(playerid,0);
new datoteka[64];
new name[24];
GetPlayerName(playerid,name,sizeof(name));
format(datoteka,sizeof(datoteka),"/korisnici/%s.txt",name);
dini_IntSet(datoteka,"Logiran",0);
if(dini_Exists(datoteka))
{
Logins(playerid);
return 1;
}
else
{
Registers(playerid);
}
return 1;
}



stock tutstr(playerid)
{
SetPlayerPos(playerid,1331.2592,-958.7347,36.6641);
cam[playerid][2]= SetTimer("tuta", 10000, false);
return 1;
}

stock tutpokreni(playerid)
{
kameratutpo(playerid);
tutstr(playerid);
return 1;
}
public tuta(playerid)
{
for(new i = 0; i < 20; i++) SendClientMessageToAll(BIJELA," ");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid,SP,"Dobrodošli na Balkan Madness Server!");
SendClientMessage(playerid,SP,"Pošto je ovo vaš prvi put da se na našem serveru prikazat cemo Vam kratak tutorial.");
SendClientMessage(playerid,SP," ");
SendClientMessage(playerid,SP,"Ovo je RolePlay server što znaci da vaš lik mora raditi sve što i Vi u stvarnome životu.");
SendClientMessage(playerid,SP,"Morate se pridržavati RolePlay pravila inace ce Vaš racun biti BAN-an ili cak izbrisan!");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
cam[playerid][3] = SetTimer("tutc", 12000, false);
return 1;
}

public tutc(playerid)
{
kamerat1(playerid);
for(new i = 0; i < 20; i++) SendClientMessageToAll(BIJELA," ");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid,SP,"Prvo cemo Vam objasniti znacenje IC(In-Character) i OOC(Out-of-character).");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid,SP,"IC je sve vezano za Vašega lika u igri,pravite se da Vaš lik zapravo glumi Vas u");
SendClientMessage(playerid,SP,"virtualnom svijetu(San Andreasu) i da tako igrate,to je VaŠe ime i prezime lika,to su i sve");
SendClientMessage(playerid,SP,"radnje vezane za Vašeg lika u igri npr. Vaš posao,kuca,automobil,motor.To sve pišete u");
SendClientMessage(playerid,SP,"obican chat(T),dok zovete nekoga na mobitel ili šaljete poruku.");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SetPlayerPos(playerid,1619.1304,-1030.4988,23.8984);
cam[playerid][4] = SetTimer("tutd", 18000, false);
return 1;
}

public tutd(playerid)
{
kamerat2(playerid);
for(new i = 0; i < 20; i++) SendClientMessageToAll(BIJELA," ");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid,SP,"OOC je sve nevezano za Vašega lika u igri.OOC su npr. imena igraca iznad glava,Vi");
SendClientMessage(playerid,SP,"neznate njihovo ime i dok ih zapravo ne upoznate preko IC chata(Bok xxx ja sam taj i taj)");
SendClientMessage(playerid,SP,"OOC je razgovor vezan za Vaš stvaran život izvan igrice,npr. igrate sa prijateljem");
SendClientMessage(playerid,SP,"iz razreda i želite ga pitati što imate za zadacu iz matke te za to koristite OOC chat(/b)");
SendClientMessage(playerid,SP,"koji se koristi i za OOC stvari(eventi,forum...) ");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SetPlayerPos(playerid,1619.7627,-1173.6202,55.3156);
cam[playerid][5] = SetTimer("tute", 15000, false);
return 1;
}

public tute(playerid)
{
for(new i = 0; i < 20; i++) SendClientMessageToAll(BIJELA," ");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid,SP,"RolePlay je igra gdje Vi simulirate pravi zivot i na to se nadovezuju sljedeca pravila:");
SendClientMessage(playerid,SP,"DM(DeathMatch) je ubijanje drugih igraca bez RolePlay razloga,na primjer:");
SendClientMessage(playerid,SP,"Vi ste civil i hodate ulicom i naidete na drugoga civila te izvadite m4 i ubijete ga.");
SendClientMessage(playerid,SP,"To se ne radi u stvarnom zivotu te je to kršenje pravila servera i najcesca kazna je");
SendClientMessage(playerid,SP,"OOC zatvor na najmanje 30 minuta(kazna se povecava što ste veci level)!");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
cam[playerid][6] = SetTimer("tutf", 15000, false);
return 1;
}

public tutf(playerid)
{
kamerat3(playerid);
for(new i = 0; i < 20; i++) SendClientMessageToAll(BIJELA," ");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid,SP,"MG(Meta-Gaming) je mješanje IC i OOC chata i korištenje OOC informacija za IC radnje.");
SendClientMessage(playerid,SP,"PG(Power-Gaming) je prisiljavanje nekog igraca na radnje koje ne žele pomocu /me komande i");
SendClientMessage(playerid,SP,"raditi radnje koje nisu moguce u stvarnom životu.");
SendClientMessage(playerid,SP,"DB(Drive By) je pucanje s mjesta vozaca na pješake,gaženj pješaka vozilom,gaženje vozila sa");
SendClientMessage(playerid,SP,"monsterom i ubijanje elisom helikoptera.");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SetPlayerPos(playerid,1564.1003,-1595.0923,26.6708);
cam[playerid][7]= SetTimer("tutg", 15000, false);
return 1;
}

public tutg(playerid)
{
kamerat4(playerid);
for(new i = 0; i < 20; i++) SendClientMessageToAll(BIJELA," ");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid,SP,"BH(Bunny Hoping) je skakanje dok trcite da bi bili brzi i skakanje sa biciklinom na visoka mjesta.");
SendClientMessage(playerid,SP,"SK(Spawn Killing) je ubijanj igraca dok se on tek spawnao.");
SendClientMessage(playerid,SP,"RK(Revenge Kill) je ubijanje iz osvete.Npr. neko vas ubije,Vi se stvorite ponovo i idete");
SendClientMessage(playerid,SP,"ubiti lika što vas je malo prije ubio.");
SendClientMessage(playerid,SP,"BA(Bug Abusing) je iskorištavanje bugova na serveru - STROGO ZABRANJNO.");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SetPlayerPos(playerid,1364.7399,-1887.6014,20.6641);
cam[playerid][8]= SetTimer("tuth", 15000, false);
return 1;
}

public tuth(playerid)
{
kamerat5(playerid);
for(new i = 0; i < 20; i++) SendClientMessageToAll(BIJELA," ");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid,SP,"Zabranjeno je razgovarati o drugim serverima te reklamacija drugis servera vam donosi BAN bez mogucnosti unbana!");
SendClientMessage(playerid,SP,"Zabranjeno je korištenje modova koji vam daju prednost nad drugim igracima!");
SendClientMessage(playerid,SP,"Zabranjeno je korištenja CHEATova i CLEO modifikacija!");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
cam[playerid][9]=SetTimer("tutz", 14000, false);
return 1;
}

public tutz(playerid)
{
for(new i = 0; i < 20; i++) SendClientMessageToAll(BIJELA," ");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid,SP,"To bi bilo to za totorijal.");
SendClientMessage(playerid,SP,"Sada sljede par pitanja u vezi RolePlay pravila.");
SendClientMessage(playerid,SP,"Nakon što tocno odgovorite na sva pitanja moci cete zapoceti igrati na serveru!");
SendClientMessage(playerid,SP,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
cam[playerid][10] = SetTimer("tutx", 11000, false);
return 1;
}

public tutx(playerid)
{
ShowPlayerDialog(playerid,pit1,DIALOG_STYLE_LIST,"Što je RolePlay","To je igranje na RP serverima\nTo je mješanj IC i OOC chata\nTo je simuliranje stvarnoga života","Dalje","");
for(new i = 0; i < 20; i++) SendClientMessageToAll(BIJELA," ");
/*new datoteka[64];
new name[24];
GetPlayerName(playerid,name,sizeof(name));
format(datoteka,sizeof(datoteka),"/korisnici/%s.txt",name);
dini_IntSet(datoteka,"Tut",1);*/
return 1;
}

ViniBorn
17/06/2012, 07:32 PM
Replace SetTimer with SetTimerEx

Ex :

SetTimer("tuta", 10000, false);


SetTimerEx("tuta", 10000, false, "i", playerid);

MarinacMrcina
17/06/2012, 07:36 PM
Ok,will do that and tell my friend to connect again.I will post after if it works.

MarinacMrcina
17/06/2012, 08:05 PM
Works fine now,thanks a lot +rep :)