ShowPlayerDialog(playerid, 70, DIALOG_STYLE_LIST, "Choose an Arena", "1- Deagle Only\n2-Sawn-off + Deagle\n3-Freeroam Arena\n4-Minigun","OK", "");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid == 70)
{
case 5: // Dialog ID 70
{
if(response)
{
switch(listitem)
{
case 1:
{
SendClientMessage(playerid, Grey, "You are now In Deagle Arena!");
SendClientMessage(playerid, Yellow, "You can change your arena Type: /switcha or (/switcharena)!");
GivePlayerWeapon(playerid, 24, 10000);
SetPlayerHealth(playerid, 100);
SetPlayerPos(playerid, 288.745971,169.350997,1007.171875);
SetPlayerInterior(playerid, 3);
}
case 2:
{
SendClientMessage(playerid, Grey, "You are now in Sawnoff + Deagle Arena!");
SendClientMessage(playerid, Yellow, "You can change your arena Type: /switcha or (/switcharena)!");
GivePlayerWeapon(playerid, 24, 10000);
GivePlayerWeapon(playerid, 26, 10000);
SetPlayerHealth(playerid, 100);
SetPlayerPos(playerid,1710.433715,-1669.379272,20.225049);
SetPlayerInterior(playerid, 18);
}
case 3:
{
SendClientMessage(playerid, Grey, "You are now in Freeroam arena!");
SendClientMessage(playerid, Yellow, "You can change your arena Type: /switcha or (/switcharena)!");
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid, 99999999);
SetPlayerPos(playerid, -1465.268676,1557.868286,1052.531250);
SetPlayerInterior(playerid, 14);
}
case 4:
{
SendClientMessage(playerid, Grey, "You are now in Minigun Arena! Your health is now 250%.");
SendClientMessage(playerid, Yellow, "You can change your arena Type: /switcha or (/switcharena)!");
GivePlayerWeapon(playerid, 38, 100000);
SetPlayerHealth(playerid, 250);
SetPlayerPos(playerid, -975.975708,1060.983032,1345.671875);
SetPlayerInterior(playerid, 10);
}
}
}
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 70)
{
if(response)
{
if(listitem == 0)
{
SendClientMessage(playerid, Grey, "You are now In Deagle Arena!");
SendClientMessage(playerid, Yellow, "You can change your arena Type: /switcha or (/switcharena)!");
GivePlayerWeapon(playerid, 24, 10000);
SetPlayerHealth(playerid, 100);
SetPlayerPos(playerid, 288.745971,169.350997,1007.171875);
SetPlayerInterior(playerid, 3);
}
if(listitem == 1)
{
SendClientMessage(playerid, Grey, "You are now in Sawnoff + Deagle Arena!");
SendClientMessage(playerid, Yellow, "You can change your arena Type: /switcha or (/switcharena)!");
GivePlayerWeapon(playerid, 24, 10000);
GivePlayerWeapon(playerid, 26, 10000);
SetPlayerHealth(playerid, 100);
SetPlayerPos(playerid,1710.433715,-1669.379272,20.225049);
SetPlayerInterior(playerid, 18);
}
if(listitem == 2)
{
SendClientMessage(playerid, Grey, "You are now in Freeroam arena!");
SendClientMessage(playerid, Yellow, "You can change your arena Type: /switcha or (/switcharena)!");
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid, 99999999);
SetPlayerPos(playerid, -1465.268676,1557.868286,1052.531250);
SetPlayerInterior(playerid, 14);
}
if(listitem == 3)
{
SendClientMessage(playerid, Grey, "You are now in Minigun Arena! Your health is now 250%.");
SendClientMessage(playerid, Yellow, "You can change your arena Type: /switcha or (/switcharena)!");
GivePlayerWeapon(playerid, 38, 100000);
SetPlayerHealth(playerid, 250);
SetPlayerPos(playerid, -975.975708,1060.983032,1345.671875);
SetPlayerInterior(playerid, 10);
}
}
}
return 1;
}
CMD:switcharena(playerid, params[])
{
ShowPlayerDialog(playerid, 70, DIALOG_STYLE_MSGBOX, "CHOOSE ARENA", "1- DEAGLE\n\nSawn-off + Deagle\n\nFreeroam\n\nMinigun","GO", "");
}
But when I typed this command and choose an arena its teleport me why?
|
SetPlayerPos(playerid,1710.433715,-1669.379272,20.225049);