25.08.2009, 17:52
Hi,
I made a tutorial for new players who come in my server, to explain them how it works. But if other people talk, they won't have the time to read the explanations. So my idea was to make a timer (1 second) which will re-send the same message, again and again, till the player want to see the next page of the tutorial or till the tutorial ends.
Another thing i noticed, if the player start the tutorial in an interior. When the tutorial will end, he will be at his positions like before he launched the tutorial but will appear bugged cause he is in interior 0. And i don't know how to save the interior of a player as a variable, like that i can add : SetPlayerInterior(playerid, interior);
How can I make/fix it ? Thanks !
I made a tutorial for new players who come in my server, to explain them how it works. But if other people talk, they won't have the time to read the explanations. So my idea was to make a timer (1 second) which will re-send the same message, again and again, till the player want to see the next page of the tutorial or till the tutorial ends.
Another thing i noticed, if the player start the tutorial in an interior. When the tutorial will end, he will be at his positions like before he launched the tutorial but will appear bugged cause he is in interior 0. And i don't know how to save the interior of a player as a variable, like that i can add : SetPlayerInterior(playerid, interior);
How can I make/fix it ? Thanks !
Код:
new TUTORIAL[MAX_PLAYER_NAME]; new Float: x, Float: y, Float: z; public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/tutoriel", cmdtext, true, 9) == 0) { GetPlayerPos(playerid, x, y, z); if (TUTORIAL[playerid] == 0) { TogglePlayerControllable(playerid, 0); SendClientMessage(playerid, 0xfd0000ff, "TEXT 1"); TUTORIAL[playerid] = 1; return 1; } } else if (strcmp("/next", cmdtext, true, 5) == 0) { if (TUTORIAL[playerid] == 1) { SendClientMessage(playerid, 0xfd0000ff, "TEXT 2"); TUTORIAL[playerid] = 2; return 1; } else if (TUTORIAL[playerid] == 2) { SendClientMessage(playerid, 0xfd0000ff, "TEXT 3"); TUTORIAL[playerid] = 3; return 1; } else if (TUTORIAL[playerid] == 3) { SetPlayerCameraPos(playerid, 1722.9542,-1560.2708,70.0261); SetPlayerCameraLookAt(playerid, 1727.0585,-1637.0344,20.2174); SetPlayerPos(playerid, 1722.9542,-1560.2708,0); SetPlayerInterior(playerid, 0); SendClientMessage(playerid, 0xfd0000, "TEXT 4"); TUTORIAL[playerid] = 4; return 1; } else if (TUTORIAL[playerid] == 4) { SetPlayerPos(playerid, x, y, z); SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid, 1); SendClientMessage(playerid, 0xfd0000, "END OF THE TUTORIAL"); TUTORIAL[playerid] = 0; return 1; } } else if (strcmp("/stop", cmdtext, true, 5) == 0) { if (TUTORIAL[playerid] == 1 || TUTORIAL[playerid] == 2 || TUTORIAL[playerid] == 3 || TUTORIAL[playerid] == 4) { SendClientMessage(playerid, 0xfd0000ff, "END OF THE TUTORIAL"); TUTORIAL[playerid] = 0; SetPlayerPos(playerid, x, y, z); SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid, 1); return 1; } } return 0; }