08.07.2011, 15:30
Hello, i tried to make a small intro when player connect to server but i failed, here is my code:
When i connect to server, it don't show me tutorial, just class selection menu. Also, i tried to replace "playerid" with "i" but it gives me errors, also i tried to define "i" like
and
but it gives errors.. Please help if you know and can Thanks anyways.
Also, i defined TutTime on the top of my script like
pawn Код:
PreloadAnimLib(playerid, animlib[]) ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
public OnPlayerConnect(playerid)
{
PreloadAnimLib(playerid,"BOMBER");
PreloadAnimLib(playerid,"RAPPING");
PreloadAnimLib(playerid,"SHOP");
PreloadAnimLib(playerid,"BEACH");
PreloadAnimLib(playerid,"SMOKING");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"ON_LOOKERS");
PreloadAnimLib(playerid,"DEALER");
PreloadAnimLib(playerid,"CRACK");
PreloadAnimLib(playerid,"CARRY");
PreloadAnimLib(playerid,"COP_AMBIENT");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"INT_HOUSE");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"PED");
//so the timer can be executed again
PlayerInfo[playerid][SpawnDance] = true;
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); //preventing a bug for the animation not being applied the first time OnPlayerRequestClass is called
TutTime[playerid] += 1;
if(TutTime[playerid] == 1)
{
TextDrawShowForPlayer(playerid,ekran);
TextDrawShowForPlayer(playerid,NLC);
TextDrawShowForPlayer(playerid,ponos);
TextDrawShowForPlayer(playerid,predstavlja);
}
else if(TutTime[playerid] == 8)
{
TextDrawHideForPlayer(playerid,predstavlja);
}
else if(TutTime[playerid] == 9)
{
TextDrawShowForPlayer(playerid,srv);
}
else if(TutTime[playerid] == 13)
{
TextDrawHideForPlayer(playerid,srv);
}
else if(TutTime[playerid] == 14)
{
TextDrawShowForPlayer(playerid,adresa);
}
else if(TutTime[playerid] == 18)
{
TextDrawHideForPlayer(playerid,adresa);
}
else if(TutTime[playerid] == 19)
{
TextDrawShowForPlayer(playerid,admini);
}
else if(TutTime[playerid] == 20)
{
TextDrawShowForPlayer(playerid,admini1);
}
else if(TutTime[playerid] == 21)
{
TextDrawShowForPlayer(playerid,admini2);
}
else if(TutTime[playerid] == 22)
{
TextDrawShowForPlayer(playerid,admini3);
}
else if(TutTime[playerid] == 23)
{
TextDrawShowForPlayer(playerid,admini4);
}
else if(TutTime[playerid] == 24)
{
TextDrawShowForPlayer(playerid,admini5);
}
else if(TutTime[playerid] == 25)
{
TextDrawShowForPlayer(playerid,admini6);
}
else if(TutTime[playerid] == 65)
{
if ( !INI_Exist( pIme( playerid ) ) )
ShowPlayerDialog( playerid, DIALOG_REG_REQ, DIALOG_STYLE_MSGBOX, "{FFFFFF}Welcome to: {00C0FF}NLC Gaming {FFFFFF}SA:MP Server. ", "{00C0FF}------------------------------------------------------------------\n{FFFFFF}You need to {00C0FF}register{FFFFFF}before spawning,\nclick on {00C0FF}OK{FFFFFF}, and then write your password,\nso you can continue playing on our server.\n{00C0FF}------------------------------------------------------------------", "Ok", "");
else
ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_MSGBOX, "{00C0FF}User profile", "{00C0FF}----------------------------------------------------------------------------\n{FFFFFF}Your account is {00C0FF}register{FFFFFF}. Write your password and log in.\nIf you are not owner of this account, please press {F81414}'cancel'\n{00C0FF}----------------------------------------------------------------------------", "Log in", "Cancel");
}
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
pawn Код:
for(new i = 0; i < TutTime; i++)
Also, i defined TutTime on the top of my script like
pawn Код:
new TutTime[MAX_PLAYERS];