14.05.2010, 16:07
Hmm why doesn't the TextDraw disapear after 2 seconds, i've tryed to fix this but
i can't seem to work out why. I will show you my code
And look at the Callback "OnPlayerRequestSpawn" And you will see it it has a reserved skin for "Jay"
Also your see TextDrawShowForPlayer
This Textdraw will show when a player trys to spawn with the reserved skin.
Now i want the TextDraw to disapear after 2 seconds, when the Player trys to spawn with the reserved skin, So i want it to disapear after 2 seconds when the TextDraw is showed. It closes after 2 seconds.
But its not letting me heres my code
-> Code:
Thanks.
i can't seem to work out why. I will show you my code
And look at the Callback "OnPlayerRequestSpawn" And you will see it it has a reserved skin for "Jay"
Also your see TextDrawShowForPlayer
This Textdraw will show when a player trys to spawn with the reserved skin.
Now i want the TextDraw to disapear after 2 seconds, when the Player trys to spawn with the reserved skin, So i want it to disapear after 2 seconds when the TextDraw is showed. It closes after 2 seconds.
But its not letting me heres my code
-> Code:
Код:
#include <a_samp>
new ChosenClass[MAX_PLAYERS];
new Text:help2;
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
help2 = TextDrawCreate(200,300,"I'm sorry but~n~But this skin~n~Is for Jay only");
TextDrawUseBox(help2,1);
TextDrawBoxColor(help2,0x000000AA);
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(101, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, -1782.5294,539.1637,194.9415);
SetPlayerFacingAngle(playerid,241.7837);
SetPlayerCameraPos(playerid, -1776.6428,534.9046,194.9415);
SetPlayerCameraLookAt(playerid, -1782.5294,539.1637,194.9415);
ChosenClass[playerid] = classid;
return 1;
}
public OnPlayerRequestSpawn(playerid)
{ new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(ChosenClass[playerid] == 0 && strcmp(PlayerName,"Jay",false) != 0)
{
TextDrawShowForPlayer(playerid,help2);
return 0;
}
return 1;
}
public OnPlayerConnect(playerid)
{ SetTimerEx("HideTextDraw",2000,false,"i",playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerInfoChange(playerid)
{
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
forward HideTextDraw(playerid);
public HideTextDraw(playerid)
{
TextDrawHideForPlayer(playerid,help2);

