Erick (13 сентября 2011 - 10:14) писал:
Нажмите сюда, чтобы прочитать это сообщение. [Показать]
Доброго времени суток! В данном уроке я расскажу вам, как создать такой текст драв для вашего мода.
И так, приступим к уроку:
В начале мода прописываем:
new Text:Intro[12];
forward ShowIntro(playerid);
Ищем public OnGameModeInit() и туда добавляем:
{
Intro[0] = TextDrawCreate(642.0, 1.0, "~n~");
TextDrawLetterSize(Intro[0], 0.5, 49.5);
TextDrawUseBox(Intro[0], 1);
TextDrawBoxColor(Intro[0], 0x000000FF);
TextDrawTextSize(Intro[0], -2.0, 0.0);
Intro[1] = TextDrawCreate(190.000000, 190.000000, "~p~~h~ERICK");
TextDrawFont(Intro[1], 2);
TextDrawLetterSize(Intro[1], 0.570000, 1.799999);
Intro[2] = TextDrawCreate(310.000000, 190.000000, "present...");
TextDrawFont(Intro[2], 2);
TextDrawColor(Intro[2], 0xFFFFFF22);
TextDrawLetterSize(Intro[2], 0.570000, 1.799999);
Intro[3] = TextDrawCreate(310.000000, 190.000000, "present...");
TextDrawFont(Intro[3], 2);
TextDrawColor(Intro[3], 0xFFFFFF44);
TextDrawLetterSize(Intro[3], 0.570000, 1.799999);
Intro[4] = TextDrawCreate(310.000000, 190.000000, "present...");
TextDrawFont(Intro[4], 2);
TextDrawColor(Intro[4], 0xFFFFFF66);
TextDrawLetterSize(Intro[4], 0.570000, 1.799999);
Intro[5] = TextDrawCreate(310.000000, 190.000000, "present...");
TextDrawFont(Intro[5], 2);
TextDrawColor(Intro[5], 0xFFFFFF88);
TextDrawLetterSize(Intro[5], 0.570000, 1.799999);
Intro[6] = TextDrawCreate(310.000000, 190.000000, "present...");
TextDrawFont(Intro[6], 2);
TextDrawColor(Intro[6], 0xFFFFFFAA);
TextDrawLetterSize(Intro[6], 0.570000, 1.799999);
Intro[7] = TextDrawCreate(310.000000, 190.000000, "present...");
TextDrawFont(Intro[7], 2);
TextDrawColor(Intro[7], 0xFFFFFFCC);
TextDrawLetterSize(Intro[7], 0.570000, 1.799999);
Intro[8] = TextDrawCreate(310.000000, 190.000000, "present...");
TextDrawFont(Intro[8], 2);
TextDrawColor(Intro[8], 0xFFFFFFFF);
TextDrawLetterSize(Intro[8], 0.570000, 1.799999);
Intro[9] = TextDrawCreate(190.0, 202.0, ".");
TextDrawFont(Intro[9], 1);
TextDrawLetterSize(Intro[9], 23.250051, 1.099999);
Intro[10] = TextDrawCreate(304.00, 223.0, "~y~~h~PAWN-WIKI.RU");
TextDrawFont(Intro[10], 2);
TextDrawLetterSize(Intro[10], 0.340000, 1.099999);
Intro[11] = TextDrawCreate(331.0, 235.0, "~g~~h~PAWN-WIKI.RU");
TextDrawFont(Intro[11], 2);
TextDrawLetterSize(Intro[11], 0.340000, 1.099999);
return 1;
}
После этого ищем public OnPlayerConnect и туда вставляем:
{
TogglePlayerSpectating(playerid, true);
ForceClassSelection(playerid);
SetPVarInt(playerid, "Intro", 0);
SetTimerEx("ShowIntro", 1000, 0, "d", playerid);
return 1;
}
После этого ищем public OnGameModeExit и туда вставляем:
{
for(new i; i < sizeof(Intro); i++)
{
TextDrawDestroy(Intro[i]);
}
return 1;
}
И после этого добавляем саму функцию паблика :
public ShowIntro(playerid)
{
SetPVarInt(playerid, "Intro", GetPVarInt(playerid, "Intro") + 1);
new iteration = GetPVarInt(playerid, "Intro");
switch(iteration)
{
case 1:
{
for(new i; i < 11; i++)
{
SendClientMessage(playerid, -1, "");
}
TextDrawShowForPlayer(playerid, Intro[0]);
}
case 2:
{
TextDrawShowForPlayer(playerid, Intro[1]);
}
case 3:
{
TextDrawShowForPlayer(playerid, Intro[2]);
}
case 4:
{
TextDrawHideForPlayer(playerid, Intro[2]);
TextDrawShowForPlayer(playerid, Intro[3]);
}
case 5:
{
TextDrawHideForPlayer(playerid, Intro[3]);
TextDrawShowForPlayer(playerid, Intro[4]);
}
case 6:
{
TextDrawHideForPlayer(playerid, Intro[4]);
TextDrawShowForPlayer(playerid, Intro[5]);
}
case 7:
{
TextDrawHideForPlayer(playerid, Intro[5]);
TextDrawShowForPlayer(playerid, Intro[6]);
}
case 8:
{
TextDrawHideForPlayer(playerid, Intro[6]);
TextDrawShowForPlayer(playerid, Intro[7]);
}
case 9:
{
TextDrawHideForPlayer(playerid, Intro[7]);
TextDrawShowForPlayer(playerid, Intro[8]);
}
case 10:
{
TextDrawShowForPlayer(playerid, Intro[9]);
}
case 11:
{
TextDrawShowForPlayer(playerid, Intro[10]);
}
case 12:
{
TextDrawShowForPlayer(playerid, Intro[11]);
}
}
if(GetPVarInt(playerid, "Intro") < 10)
{
SetTimerEx("ShowIntro", 300, 0, "d", playerid);
}
else if(9 < GetPVarInt(playerid, "Intro") < 13)
{
SetTimerEx("ShowIntro", 2000, 0, "d", playerid);
}
else
{
for(new i; i < sizeof(Intro); i++)
{
TextDrawHideForPlayer(playerid, Intro[i]);
}
TogglePlayerSpectating(playerid, false);
ForceClassSelection(playerid);
}
return 1;
}
Автор: OKStyle
Переделал: Erick
Такое уже есть на сайте, только в FS. Ссылка.
Что там не так?
C:\Users\User\Desktop\Emerald RP\pawno\include\streamer.inc(320) : error 017: undefined symbol "Streamer_OnPlayerEditObject"
C:\Users\User\Desktop\Emerald RP\pawno\include\streamer.inc(343) : error 017: undefined symbol "Streamer_OnPlayerSelectObject"
C:\Users\User\Desktop\Emerald RP\pawno\include\streamer.inc(363) : error 017: undefined symbol "Streamer_OnPlayerPickUpPickup"
C:\Users\User\Desktop\Emerald RP\pawno\include\streamer.inc(383) : error 017: undefined symbol "Streamer_OnPlayerEnterCP"
C:\Users\User\Desktop\Emerald RP\pawno\include\streamer.inc(403) : error 017: undefined symbol "Streamer_OnPlayerLeaveCP"
C:\Users\User\Desktop\Emerald RP\pawno\include\streamer.inc(423) : error 017: undefined symbol "Streamer_OnPlayerEnterRaceCP"
C:\Users\User\Desktop\Emerald RP\pawno\include\streamer.inc(443) : error 017: undefined symbol "Streamer_OnPlayerLeaveRaceCP"
C:\Users\User\Desktop\Emerald RP\pawno\include\YSI\internal\..\y_scriptinit.inc(258) : error 017: undefined symbol "ScriptInit_OnGameModeExit"
C:\Users\User\Desktop\Emerald RP\pawno\include\YSI\internal\..\y_scriptinit.inc(270) : error 017: undefined symbol "ScriptInit_OnGameModeExit"
C:\Users\User\Desktop\Emerald RP\pawno\include\YSI\y_iterate.inc(909) : error 017: undefined symbol "Itter_OnPlayerDisconnect"
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(1479) : error 017: undefined symbol "SPD"
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2528) : warning 202: number of arguments does not match definition
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2528) : warning 202: number of arguments does not match definition
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2530) : warning 225: unreachable code
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2846) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2846) : error 017: undefined symbol "SPD"
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2848) : error 017: undefined symbol "dialogid"
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2849) : error 017: undefined symbol "dialogid"
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2853) : warning 225: unreachable code
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2853) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2853) : error 004: function "OnDialogResponse" is not implemented
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2855) : error 017: undefined symbol "inputtext"
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2855) : error 017: undefined symbol "inputtext"
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2855) : warning 215: expression has no effect
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2855) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\Emerald RP\gamemodes\modik.pwn(2855) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
21 Errors.