04.11.2009, 13:55
Hi,
A friend of my made a tutorial script for me; i put it in my GM, there where no error/warnings.
Now, when I connect to my server, it shows the first message and teleports to the first location, etc..
But it isn't moving on (it hangs at the first message)
The Script;
Sorry, comments are in Dutch 
Thanks in forward (Is that right English? ;P)
A friend of my made a tutorial script for me; i put it in my GM, there where no error/warnings.
Now, when I connect to my server, it shows the first message and teleports to the first location, etc..
But it isn't moving on (it hangs at the first message)
The Script;
Код:
#include <a_samp> new Float:ppos[MAX_PLAYERS][4], Float:Cam[5][3] = // waar de cam staat. { {213.9867,1884.2385,98.3855}, // tut 1 {213.9867,1884.2385,98.3855}, // tut 2 {213.9867,1884.2385,98.3855}, // tut 3 {214.5931,1890.1830,127.2952}, // tut 4 {214.5931,1890.1830,127.2952} // tut 5 }, Float:View[5][3] = // waar de cam naar moet kijken. { {213.9867,1884.2385,98.3855}, // tut 1 {213.9867,1884.2385,98.3855}, // tut 2 {213.9867,1884.2385,98.3855}, // tut 3 {214.5931,1890.1830,127.2952}, // tut 4 {214.5931,1890.1830,127.2952} // tut 5 }, tText[5][2012] = // de tekst die er bij moet komen. { {"Test1"}, // tut 1 {"Test2"}, // tut 2 {"Test3"}, // tut 3 {"Test4"}, // tut 4 {"Test5"} // tut 5 }; stock Crshr_Spawn(p) // doe hier wat er moet gebeuren als de speler de tut al eens heeft gehad. { SetCameraBehindPlayer(p); SetPlayerPos(p,ppos[p][0],ppos[p][1],ppos[p][2]); SetPlayerFacingAngle(p,ppos[p][3]); return 1; } stock Crshr_Tutorial_Exit(p) { // doe hier wat er moet gebeuren na de tut, de pos en angle,cam wordt al hersteld, dus laat ut onderste staan!!!. SetCameraBehindPlayer(p); SetPlayerPos(p,ppos[p][0],ppos[p][1],ppos[p][2]); SetPlayerFacingAngle(p,ppos[p][3]); TogglePlayerControllable(p,1); return 1; } //=============================================================================« //=============================================================================« //=============================================================================« //=============================================================================« new // Vanaf hier met je tengels er af blijfen. //=============================================== //=============================================== bool:tut[MAX_PLAYERS], Text:txt[MAX_PLAYERS]; public OnPlayerConnect(playerid) { new p = playerid,string[256]; format(string,256,"~w~Welcome ~r~%s ~w~to our server",Crshr_GetPlayerName(p)); txt[p] = TextDrawCreate(10.0, 280.0,string); TextDrawUseBox(txt[p],1); TextDrawBoxColor(txt[p],0x222222BB); TextDrawLetterSize(txt[p],0.3,1.0); TextDrawTextSize(txt[p],400.0,40.0); TextDrawFont(txt[p], 2); TextDrawSetShadow(txt[p],0); TextDrawSetOutline(txt[p],1); TextDrawBackgroundColor(txt[p],0x000000FF); TextDrawColor(txt[p],0xFFFFFFFF); return 1; } public OnPlayerDisconnect(playerid, reason) { new p = playerid; TextDrawDestroy(txt[p]); return 1; } public OnPlayerSpawn(playerid) { new p = playerid; if(tut[p] == false) { TogglePlayerControllable(p,0); GetPlayerPos(p,ppos[p][0],ppos[p][1],ppos[p][2]); GetPlayerFacingAngle(p,ppos[p][3]); Crshr_Tutorial_init(p,1); } else { Crshr_Spawn(p); } return 1; } stock Crshr_Tutorial_init(p,i) { switch(i) { case 1: { SetPlayerCameraPos(p,Cam[0][0],Cam[0][1],Cam[0][2]); SetPlayerCameraLookAt(p,View[0][0],View[0][1],View[0][2]); Crshr_SetTutText(p,tText[0]); SetTimerEx("Crshr_Tutorial_init",8000,false,"i,i",p,2); } case 2: { SetPlayerCameraPos(p,Cam[1][0],Cam[1][1],Cam[1][2]); SetPlayerCameraLookAt(p,View[1][0],View[1][1],View[1][2]); Crshr_SetTutText(p,tText[1]); SetTimerEx("Crshr_Tutorial_init",8000,false,"i,i",p,3); } case 3: { SetPlayerCameraPos(p,Cam[2][0],Cam[2][1],Cam[2][2]); SetPlayerCameraLookAt(p,View[2][0],View[2][1],View[2][2]); Crshr_SetTutText(p,tText[2]); SetTimerEx("Crshr_Tutorial_init",8000,false,"i,i",p,4); } case 4: { SetPlayerCameraPos(p,Cam[3][0],Cam[3][1],Cam[3][2]); SetPlayerCameraLookAt(p,View[3][0],View[3][1],View[3][2]); Crshr_SetTutText(p,tText[3]); SetTimerEx("Crshr_Tutorial_init",8000,false,"i,i",p,5); } case 5: { SetPlayerCameraPos(p,Cam[0][0],Cam[0][1],Cam[0][2]); SetPlayerCameraLookAt(p,View[0][0],View[0][1],View[0][2]); Crshr_SetTutText(p,tText[0]); SetTimerEx("Crshr_Tutorial_Exit",8000,false,"i",p); } } return 1; } stock Crshr_SetTutText(p,Tuttxt[]) { TextDrawHideForPlayer(p,txt[p]); TextDrawSetString(txt[p],Tuttxt); TextDrawShowForPlayer(p,txt[p]); return 1; } stock Crshr_GetPlayerName(p) { new name[256]; if(IsPlayerConnected(p)) { GetPlayerName(p,name,256); return name; } else { name = "Unknown"; return name; } }

Thanks in forward (Is that right English? ;P)