//gang join textdraw
new Text:gangname[MAX_PLAYERS];
public OnPlayerRequestSpawn(playerid)
{
new pname[MAX_PLAYER_NAME], string[128], gname[10];
if(gTeam[playerid] == 0) format(gname, sizeof(gname), "BALLAS");
else if(gTeam[playerid] == 1) format(gname, sizeof(gname), "GROVE");
else if(gTeam[playerid] == 2) format(gname, sizeof(gname), "VAGOS");
else if(gTeam[playerid] == 3) format(gname, sizeof(gname), "AZTECAS");
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "~r~%s ~w~has spawned as ~y~%s", pname, gname);
TextDrawSetString(gangname[playerid], string);
TextDrawShowForPlayer(playerid, gangname[playerid]);
return 1;
}
public LoadTextDraws()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
gangname[i] = TextDrawCreate(1.129997, 195.226608, "_");
TextDrawLetterSize(gangname[i], 0.227700, 1.720800);
TextDrawAlignment(gangname[i], 1);
TextDrawColor(gangname[i], -1378294017);
TextDrawSetShadow(gangname[i], 0);
TextDrawSetOutline(gangname[i], 1);
TextDrawBackgroundColor(gangname[i], 255);
TextDrawFont(gangname[i], 3);
TextDrawSetProportional(gangname[i], 1);
TextDrawSetShadow(gangname[i], 0);
}
}
it's request spawn not request class
EDIT: do i have to make textdraw again and again like make textdraw for ballas then grove and vagos and aztecas can't it can be done with one textdraw |
new Team_Message1[128]; new Team_Message2[128]; public OnPlayerRequestSpawn(playerid) { new pname[MAX_PLAYER_NAME], string[128], gname[10]; if(gTeam[playerid] == 0) format(gname, sizeof(gname), "BALLAS"); else if(gTeam[playerid] == 1) format(gname, sizeof(gname), "GROVE"); else if(gTeam[playerid] == 2) format(gname, sizeof(gname), "VAGOS"); else if(gTeam[playerid] == 3) format(gname, sizeof(gname), "AZTECAS"); GetPlayerName(playerid, pname, sizeof(pname)); format(Team_Message2, 170, Team_Message1); format(Team_Message1,sizeof Team_Message1,"~r~%s Has Spawned as ~y~%d.", pname. gname); format(string, sizeof(string), "%s~n~%s", Team_Message1, Team_Message2); TextDrawSetString(gangname[playerid], string); TextDrawShowForPlayer(playerid, gangname[playerid]); return 1; }
static count = 0;
new Text:teamjointd[4];
public OnPlayerRequestClass(playerid, classid)
{
for(new i = 0; i < 4; i++)
{
TextDrawHideForAll(teamjointd[i]);
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
for(new i = 0; i < 4; i++)
{
TextDrawShowForAll(teamjointd[i]);
}
new pname[MAX_PLAYER_NAME], string[128], gname[10];
if(gTeam[playerid] == 0) format(gname, sizeof(gname), "BALLAS");
else if(gTeam[playerid] == 1) format(gname, sizeof(gname), "GROVE");
else if(gTeam[playerid] == 2) format(gname, sizeof(gname), "VAGOS");
else if(gTeam[playerid] == 3) format(gname, sizeof(gname), "AZTECAS");
GetPlayerName(playerid, pname, sizeof(pname));
switch(count)
{
case 0:
{
format(string, sizeof(string), "~r~%s ~w~has joined ~y~%s ~w~team", pname, gname);
TextDrawSetString(teamjointd[0], string);
count = 1;
}
case 1:
{
format(string, sizeof(string), "~n~~r~%s ~w~has joined ~y~%s ~w~team", pname, gname);
TextDrawSetString(teamjointd[0], string);
count = 2;
}
case 2:
{
format(string, sizeof(string), "~n~~n~~r~%s ~w~has joined ~y~%s ~w~team", pname, gname);
TextDrawSetString(teamjointd[0], string);
count = 3;
}
case 3:
{
format(string, sizeof(string), "~n~~n~~n~~r~%s ~w~has joined ~y~%s ~w~team", pname, gname);
TextDrawSetString(teamjointd[0], string);
count = 0;
}
}
return 1;
}
forward LoadTextDraws();
public LoadTextDraws()
{
teamjointd[0] = TextDrawCreate(4.666670, 193.186706, "_");
TextDrawLetterSize(teamjointd[0], 0.177401, 1.720800);
TextDrawAlignment(teamjointd[0], 1);
TextDrawColor(teamjointd[0], -1378294017);
TextDrawSetShadow(teamjointd[0], 0);
TextDrawSetOutline(teamjointd[0], 1);
TextDrawBackgroundColor(teamjointd[0], 255);
TextDrawFont(teamjointd[0], 3);
TextDrawSetProportional(teamjointd[0], 1);
TextDrawSetShadow(teamjointd[0], 0);
teamjointd[1] = TextDrawCreate(29.199960, 170.586654, "_");
TextDrawLetterSize(teamjointd[1], 0.400000, 1.600000);
TextDrawTextSize(teamjointd[1], 0.000000, 295.000000);
TextDrawAlignment(teamjointd[1], 2);
TextDrawColor(teamjointd[1], -1);
TextDrawUseBox(teamjointd[1], 1);
TextDrawBoxColor(teamjointd[1], 255);
TextDrawSetShadow(teamjointd[1], 0);
TextDrawSetOutline(teamjointd[1], 0);
TextDrawBackgroundColor(teamjointd[1], 255);
TextDrawFont(teamjointd[1], 1);
TextDrawSetProportional(teamjointd[1], 1);
TextDrawSetShadow(teamjointd[1], 0);
teamjointd[2] = TextDrawCreate(29.199960, 191.093368, "_");
TextDrawLetterSize(teamjointd[2], 0.409600, 17.857463);
TextDrawTextSize(teamjointd[2], 0.000000, 295.000000);
TextDrawAlignment(teamjointd[2], 2);
TextDrawColor(teamjointd[2], -1);
TextDrawUseBox(teamjointd[2], 1);
TextDrawBoxColor(teamjointd[2], 842150450);
TextDrawSetShadow(teamjointd[2], 0);
TextDrawSetOutline(teamjointd[2], 0);
TextDrawBackgroundColor(teamjointd[2], 255);
TextDrawFont(teamjointd[2], 1);
TextDrawSetProportional(teamjointd[2], 1);
TextDrawSetShadow(teamjointd[2], 0);
teamjointd[3] = TextDrawCreate(47.599987, 168.346527, "Team_Join");
TextDrawLetterSize(teamjointd[3], 0.400000, 1.600000);
TextDrawAlignment(teamjointd[3], 1);
TextDrawColor(teamjointd[3], -5963521);
TextDrawSetShadow(teamjointd[3], 0);
TextDrawSetOutline(teamjointd[3], 1);
TextDrawBackgroundColor(teamjointd[3], 255);
TextDrawFont(teamjointd[3], 1);
TextDrawSetProportional(teamjointd[3], 1);
TextDrawSetShadow(teamjointd[3], 0);
}