16.07.2011, 08:43
Quote:
Hello,
I need a tutorial on how to make a message enter the Players screen when he/she enters any vehicle. Here is what I want written "Please Do not Drive Non RPly, Drive like you would in real life, Driving Non RPly will result in Admin Jail" |
PHP код:
// Top of script
new Text:VehicleMessage;
new bool:PlayerVehMessage[MAX_PLAYERS char];
// OnGameModeInit OR OnFilterScriptInit
public OnGameModeInit()
{
VehicleMessage = TextDrawCreate(332.000000,404.000000,"Please Do ~r~~h~not ~w~Drive Non RPly,~n~Drive like you would in real life,~n~Driving Non RPly will result in ~r~~h~Admin Jail");
TextDrawAlignment(VehicleMessage,0);
TextDrawBackgroundColor(VehicleMessage,0x000000ff);
TextDrawFont(VehicleMessage,3);
TextDrawLetterSize(VehicleMessage,0.399999,1.400000);
TextDrawColor(VehicleMessage,0xffffffff);
TextDrawSetOutline(VehicleMessage,1);
TextDrawSetProportional(VehicleMessage,1);
TextDrawSetShadow(VehicleMessage,1);
}
// OnPlayerStateChange
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
PlayerVehMessage {playerid} = true;
TextDrawShowForPlayer(playerid, VehicleMessage);
SetTimerEx("RemoveVehMessage", 5000, false, "d", playerid);
}
return 1;
}
// OnPlayerExitVehicle
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(PlayerVehMessage {playerid})
{
PlayerVehMessage {playerid} = false;
TextDrawHideForPlayer(playerid, VehicleMessage);
}
return 1;
}
forward RemoveVehMessage(playerid); public RemoveVehMessage(playerid)
{
if(PlayerVehMessage {playerid})
{
PlayerVehMessage {playerid} = !true;
TextDrawHideForPlayer(playerid, VehicleMessage);
}
return;
}
/imageshack/img62/8769/samp034sf.png
/imageshack/img580/6338/samp035dk.png