20.12.2018, 17:43
Does it mean that I should not use 'SetPlayerTeam' for each team?
This is what I have in my script, is it wrong?:
This is what I have in my script, is it wrong?:
PHP Code:
//Command
ShowPlayerDialog(playerid, Dialog_PTP, DIALOG_STYLE_LIST, "PTP - TEAMS", "President\nPolice\nTerrorist", "Select", "Close");
//OnDialogResponse
case Dialog_PTP:
{
if(response)
{
switch(listitem)
{
case 0:
{
SetPlayerTeam(playerid, Team_President); // team 0
new index = random(sizeof(Ptp_Pos[])), team = GetPlayerTeam(playerid);
SetPlayerPos(playerid, Ptp_Pos[team][index][0], Ptp_Pos[team][index][1], Ptp_Pos[team][index][2]);
SetPlayerFacingAngle(playerid, Ptp_Pos[team][index][3]);
//other codes
}
case 1:
{
SetPlayerTeam(playerid, Team_Police); // team 1
new index = random(sizeof(Ptp_Pos[])), team = GetPlayerTeam(playerid);
SetPlayerPos(playerid, Ptp_Pos[team][index][0], Ptp_Pos[team][index][1], Ptp_Pos[team][index][2]);
SetPlayerFacingAngle(playerid, Ptp_Pos[team][index][3]);
//other codes
}
case 2:
{
SetPlayerTeam(playerid, Team_Terrorist); // team 2
new index = random(sizeof(Ptp_Pos[])), team = GetPlayerTeam(playerid);
SetPlayerPos(playerid, Ptp_Pos[team][index][0], Ptp_Pos[team][index][1], Ptp_Pos[team][index][2]);
SetPlayerFacingAngle(playerid, Ptp_Pos[team][index][3]);
//other codes
}
}
}
return 1;
}