CMD:vstunt( playerid, params[ ] ) { SetPlayerPos(playerid, 2078.6533,-2543.2195,18.5390); SetPlayerFacingAngle(playerid, 0.0); SendClientMessage(playerid, COLOR_WHITE, "{F3FF02}[TELEPORT] {B7FF00}: {FFFFFF}You have teleported to Vortex Stunt"); new newtext[41], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(newtext, sizeof(newtext), "%s has teleported to /vstunt", name); TextDrawSetString(TeleportTextdraw0, newtext); TextDrawShowForPlayer(playerid, TeleportTextdraw0); return 1; } CMD:ls( playerid, params[ ] ) { if(IsPlayerInAnyVehicle(playerid)) { new vehid = GetPlayerVehicleID(playerid); SetPlayerPos(playerid,2483.0735,-1669.1608,13.4763); SetVehiclePos(vehid,2483.0735,-1669.1608,13.4763); PutPlayerInVehicle(playerid,vehid,0); SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0); SendClientMessage(playerid, COLOR_WHITE, "{F3FF02}[TELEPORT] {B7FF00}: {FFFFFF}You have teleported to Los Santos"); new newtext[41], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(newtext, sizeof(newtext), "%s has teleported to /ls", name); TextDrawSetString(TeleportTextdraw1, newtext); TextDrawHideForPlayer(playerid, TeleportTextdraw0); TextDrawShowForPlayer(playerid, TeleportTextdraw1); } else { SetPlayerPos(playerid,2497.1946,-1669.4393,13.4763); SetPlayerFacingAngle(playerid, 0.0); SendClientMessage(playerid, COLOR_WHITE, "{F3FF02}[TELEPORT] {B7FF00}: {FFFFFF}You have teleported to Los Santos"); new newtext[41], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(newtext, sizeof(newtext), "%s has teleported to /ls", name); TextDrawSetString(TeleportTextdraw1, newtext); TextDrawHideForPlayer(playerid, TeleportTextdraw0); TextDrawShowForPlayer(playerid, TeleportTextdraw1); } return 1; }
Can you show the code where you create the textdraws? I make be able to make a small function for you that will make this much easier to do.
|
//ongamemodeinit Textdraw3 = TextDrawCreate(182.254776, 189.583389, "-"); TextDrawLetterSize(Textdraw3, 19.878625, 0.771667); TextDrawAlignment(Textdraw3, 1); TextDrawColor(Textdraw3, 16711935); TextDrawSetShadow(Textdraw3, 0); TextDrawSetOutline(Textdraw3, 1); TextDrawBackgroundColor(Textdraw3, 51); TextDrawFont(Textdraw3, 1); TextDrawSetProportional(Textdraw3, 1);
Can you show me all the textdraws? You have different names, TeleportTextdraw0 now Textdraw3... I need to see all of them.
|
Textdraw0 = TextDrawCreate(430.570800, 381.499908, "[TELEPORT]: -"); TextDrawLetterSize(Textdraw0, 0.259311, 1.290833); TextDrawAlignment(Textdraw0, 1); TextDrawColor(Textdraw0, -1); TextDrawSetShadow(Textdraw0, 0); TextDrawSetOutline(Textdraw0, 1); TextDrawBackgroundColor(Textdraw0, 51); TextDrawFont(Textdraw0, 1); TextDrawSetProportional(Textdraw0, 1); Textdraw1 = TextDrawCreate(429.633544, 365.750030, "[TELEPORT]: -"); TextDrawLetterSize(Textdraw1, 0.259311, 1.425000); TextDrawAlignment(Textdraw1, 1); TextDrawColor(Textdraw1, -1); TextDrawSetShadow(Textdraw1, 0); TextDrawSetOutline(Textdraw1, 1); TextDrawBackgroundColor(Textdraw1, 51); TextDrawFont(Textdraw1, 1); TextDrawSetProportional(Textdraw1, 1); Textdraw2 = TextDrawCreate(429.633941, 351.166534, "[TELEPORT]: -"); TextDrawLetterSize(Textdraw2, 0.257437, 1.413334); TextDrawAlignment(Textdraw2, 1); TextDrawColor(Textdraw2, -1); TextDrawSetShadow(Textdraw2, 0); TextDrawSetOutline(Textdraw2, 1); TextDrawBackgroundColor(Textdraw2, 51); TextDrawFont(Textdraw2, 1); TextDrawSetProportional(Textdraw2, 1); Textdraw3 = TextDrawCreate(429.165588, 336.000000, "[TELEPORT]: -"); TextDrawLetterSize(Textdraw3, 0.257906, 1.355000); TextDrawAlignment(Textdraw3, 1); TextDrawColor(Textdraw3, -1); TextDrawSetShadow(Textdraw3, 0); TextDrawSetOutline(Textdraw3, 1); TextDrawBackgroundColor(Textdraw3, 51); TextDrawFont(Textdraw3, 1); TextDrawSetProportional(Textdraw3, 1);
enum TeleData
{
Text:TextID,
TextString[50]
};
new Textdraw[4][TeleData];
public OnGameModeInit()
{
Textdraw[0][TextID] = TextDrawCreate(430.570800, 381.499908, "[TELEPORT]: -");
TextDrawLetterSize(Textdraw[0][TextID], 0.259311, 1.290833);
TextDrawAlignment(Textdraw[0][TextID], 1);
TextDrawColor(Textdraw[0][TextID], -1);
TextDrawSetShadow(Textdraw[0][TextID], 0);
TextDrawSetOutline(Textdraw[0][TextID], 1);
TextDrawBackgroundColor(Textdraw[0][TextID], 51);
TextDrawFont(Textdraw[0][TextID], 1);
TextDrawSetProportional(Textdraw[0][TextID], 1);
Textdraw[1][TextID] = TextDrawCreate(429.633544, 365.750030, "[TELEPORT]: -");
TextDrawLetterSize(Textdraw[1][TextID], 0.259311, 1.425000);
TextDrawAlignment(Textdraw[1][TextID], 1);
TextDrawColor(Textdraw[1][TextID], -1);
TextDrawSetShadow(Textdraw[1][TextID], 0);
TextDrawSetOutline(Textdraw[1][TextID], 1);
TextDrawBackgroundColor(Textdraw[1][TextID], 51);
TextDrawFont(Textdraw[1][TextID], 1);
TextDrawSetProportional(Textdraw[1][TextID], 1);
Textdraw[2][TextID] = TextDrawCreate(429.633941, 351.166534, "[TELEPORT]: -");
TextDrawLetterSize(Textdraw[2][TextID], 0.257437, 1.413334);
TextDrawAlignment(Textdraw[2][TextID], 1);
TextDrawColor(Textdraw[2][TextID], -1);
TextDrawSetShadow(Textdraw[2][TextID], 0);
TextDrawSetOutline(Textdraw[2][TextID], 1);
TextDrawBackgroundColor(Textdraw[2][TextID], 51);
TextDrawFont(Textdraw[2][TextID], 1);
TextDrawSetProportional(Textdraw[2][TextID], 1);
Textdraw[3][TextID] = TextDrawCreate(429.165588, 336.000000, "[TELEPORT]: -");
TextDrawLetterSize(Textdraw[3][TextID], 0.257906, 1.355000);
TextDrawAlignment(Textdraw[3][TextID], 1);
TextDrawColor(Textdraw[3][TextID], -1);
TextDrawSetShadow(Textdraw[3][TextID], 0);
TextDrawSetOutline(Textdraw[3][TextID], 1);
TextDrawBackgroundColor(Textdraw[3][TextID], 51);
TextDrawFont(Textdraw[3][TextID], 1);
TextDrawSetProportional(Textdraw[3][TextID], 1);
return 1;
}
CMD:vstunt(playerid, params[])
{
SetPlayerPos(playerid, 2078.6533, -2543.2195, 18.5390);
SetPlayerFacingAngle(playerid, 0.0);
SendClientMessage(playerid, COLOR_WHITE, "{F3FF02}[TELEPORT] {B7FF00}: {FFFFFF}You have teleported to Vortex Stunt");
AddTeleport(playerid, "/vstunt");
return 1;
}
CMD:ls(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehid, 2483.0735, -1669.1608, 13.4763);
PutPlayerInVehicle(playerid, vehid, 0);
SetVehicleZAngle(vehid, 0.0);
}
else
{
SetPlayerPos(playerid, 2497.1946, -1669.4393, 13.4763);
SetPlayerFacingAngle(playerid, 0.0);
}
SendClientMessage(playerid, COLOR_WHITE, "{F3FF02}[TELEPORT] {B7FF00}: {FFFFFF}You have teleported to Los Santos");
AddTeleport(playerid, "/ls");
return 1;
}
AddTeleport(playerid, const location[])
{
new string[50], secondary[50], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(secondary, sizeof(secondary), "%s has teleported to %s", playername, location);
for(new i = 0; i < sizeof(Textdraw); i++)
{
string = secondary;
format(secondary, sizeof(secondary), "%s", Textdraw[i][TextString]);
TextDrawSetString(Textdraw[i][TextID], string);
Textdraw[i][TextString] = string;
TextDrawShowForAll(Textdraw[i][TextID]);
}
return 1;
}
AddTeleport(playerid, command);
AddTeleport(playerid, "/sanfierro");