21.04.2014, 19:09
Eu queria que quando o player apertasse spawn aparecer o dialog de resgate fiz isto mais aparece o dialog dps de dar spawn... olha aiii eu so fiz o de caminhoneiro... mais vo continuar...
aki й os cуdigo de localizaзгo de cada resgate..isso ta na PPC_Dialog
pawn Код:
///No GM
public OnPlayerSpawn(playerid)
{
ResgateD(playerid);
//PPC_DefCars
ResgateD(playerid)
{
switch (APlayerData[playerid][PlayerClass])
{
case ClassTruckDriver: // Ask where the trucker player wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Resgate para caminhoneiro:", "1.Fallen Tree Depot\r\n2.Flint Trucking Depot\r\n3.LVA Freight Depot\r\n4.Doherty Depot\r\n5.El Corona Depot\r\n6.Las Payasdas Depot\r\n7.Quarry Top\r\n8.Quarry Top 2\r\n9.Shady Creek Depot\r\n10.Bone County\r\n11.Julius Thuruway East", "Spawn", "Cancel");
case ClassBusDriver: // Ask where the busdriver wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Resgate para motorista de onibus:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
case ClassPilot: // Ask where the pilot wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Resgate para piloto de aviao:", "Los Santos\r\nSan Fierro\r\nLas Venturas\r\nAeroporto Abandonado", "Spawn", "Cancel");
case ClassPolice: // Ask where the police player wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Resgate para policia:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
case ClassCourier: // Ask where the courier player wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Resgate para correios:", "Los Santos\r\nSan Fierro\r\nLas Venturas", "Spawn", "Cancel");
case ClassMafia:
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Resgate para Mafiosos:", "San Fierro\r\nLas Venturas\nLos Santos", "Spawn", "Cancel");
}
}
//PPC_Dialogs
///em Dialog_Rescue(playerid, response, listitem)
//Colocar em cada case ResgateD(playerid); Exemplo:
case ClassTruckDriver:
{
ResgateD(playerid);
switch (listitem)
{case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -525.0, -502.0, 26.0, 0.0, 0, 0, 0, 0, 0, 0);
case 1: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -74.7000, -1137.5000, 4.1890, 0, 0, 0, 0, 0, 0, 0);
case 2: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1457.0000, 975.5000, 10.8203, 0, 0, 0, 0, 0, 0, 0);
case 3: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -2136.0000, -247.5000, 36.2392, 0, 0, 0, 0, 0, 0, 0);
case 4: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1766.7217,-2040.6144,13.5269,271.8799, 0, 0, 0, 0, 0, 0);
case 5: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -546.0000,2594.0000,53.5156,271.8799, 0, 0, 0, 0, 0, 0);
case 6: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 332.1389, 899.7020, 24.7753, 205.0000, 0, 0, 0, 0, 0, 0);
case 7: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 682.6729,860.3258,-42.4911,271.8799, 0, 0, 0, 0, 0, 0);
case 8: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -1573.3943,-2725.6587,48.7435,141.2679, 0, 0, 0, 0, 0, 0);
case 9: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 638.1900,1683.8300,6.9922,36.2600,0,0,0,0,0,0);
case 10: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 2773.2700,2561.8101,10.8203,15.4000,0,0,0,0,0,0);
case 11: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1386.40, 2696.84,10.82,179.5650,0,0,0,0,0,0);
case 12: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 331.92, 900.41, 24.63,179.5650,0,0,0,0,0,0);
case 13: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -2466.48, 2250.48,4.80,179.5650,0,0,0,0,0,0);
case 14: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -2379.24,-597.92,132.11,179.5650,0,0,0,0,0,0);
case 15: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -50.1309,-271.1847,6.6332,179.5650,0,0,0,0,0,0);
}
}
pawn Код:
Dialog_Rescue(playerid, response, listitem)
{
// Just close the dialog if the player clicked "Cancel"
if(!response) return 1;
// Check the class of the player
switch (APlayerData[playerid][PlayerClass])
{
case ClassTruckDriver:
{
// Set the spawn coordinates based on the selection in the list
switch (listitem)
{
case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -525.0, -502.0, 26.0, 0.0, 0, 0, 0, 0, 0, 0);
case 1: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 13.6354,1543.1522,12.8126,181.8199,0,0,0,0,0,0);
case 2: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1457.0, 975.5, 11.0, 0.0, 0, 0, 0, 0, 0, 0);
case 3: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -2119.9902,-967.1157,32.0234,89.6953,0,0,0,0,0,0);
case 4: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1766.5, -2040.7, 14.0, 270.0, 0, 0, 0, 0, 0, 0);
case 5: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -546.0, 2594.0, 54.0, 270.0, 0, 0, 0, 0, 0, 0);
case 6: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -2185.7,-218.0,36.5,271.1, 0, 0, 0, 0, 0, 0);
case 7: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -1575.0, -2724.0, 49.0, 146.0, 0, 0, 0, 0, 0, 0);
case 8: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 636.2756,1684.1216,6.9922,128.9503,0,0,0,0,0,0);
case 9: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1085.9821,-1775.7437,13.3441,1.3506,0,0,0,0,0,0);
case 10: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -50.1309,-271.1847,6.6332,179.5650,0,0,0,0,0,0);
case 11: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 2734.70, -2447.61, 17.59, 0, 0, 0, 0, 0, 0, 0);
}
}
case ClassBusDriver:
{
// Set the spawn coordinates based on the selection in the list
switch (listitem)
{
case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1809.0, -1905.0, 13.6, 90.0, 0, 0, 0, 0, 0, 0);
case 1: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -1983.0, 110.0, 27.7, 180.0, 0, 0, 0, 0, 0, 0);
case 2: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1060.0, 1260.0, 11.0, 270.0, 0, 0, 0, 0, 0, 0);
}
}
case ClassPilot:
{
// Set the spawn coordinates based on the selection in the list
switch (listitem)
{
case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 2010.0, -2345.0, 13.6, 90.0, 0, 0, 0, 0, 0, 0);
case 1: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -1211.0, -105.0, 14.2, 135.0, 0, 0, 0, 0, 0, 0);
case 2: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1630.0, 1615.0, 10.9, 90.0, 0, 0, 0, 0, 0, 0);
case 3: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 403.2713,2535.5229,16.5456,118.9334,0,0,0,0,0,0);
case 4: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -1396.8889,498.7867,18.2344,25.8079,0,0,0,0,0,0);
}
}
case ClassPolice:
{
// Set the spawn coordinates based on the selection in the list
switch (listitem)
{
case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1568.5, -1693.5, 6.0, 180.0, 0, 0, 0, 0, 0, 0);
case 1: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -1590.0, 716.25, -5.0, 270.0, 0, 0, 0, 0, 0, 0);
case 2: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 2275.0, 2460.0, 10.9, 90.0, 0, 0, 0, 0, 0, 0);
}
}
case ClassLixeiro:
{
// Set the spawn coordinates based on the selection in the list
switch (listitem)
{
case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 2268.5,-2083.8000488281,17.299999237061,132.0, 0, 0, 0, 0, 0, 0);//Resgate de LS
case 1: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -1848.1999511719,111.40000152588,15.10000038147,2.00228881, 0, 0, 0, 0, 0, 0);//Resgate de SF
case 2: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1094.9000244141,1910.5,10.800000190735,270.001373, 0, 0, 0, 0, 0, 0);
}
}
case ClassPizza:
{
// Set the spawn coordinates based on the selection in the list
switch (listitem)
{
case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 2105.8000488281,-1806.5,13.60000038147,92.0036315, 0, 0, 0, 0, 0, 0);
}
}
case ClassMendigo:
{
// Set the spawn coordinates based on the selection in the list
switch (listitem)
{
case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 382.60000610352,2607.6999511719,16.5,194.002288, 0, 0, 0, 0, 0, 0);
}
}
case ClassCourier:
{
// Set the spawn coordinates based on the selection in the list
switch (listitem)
{
case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 798.0, -618.75, 16.4, 0.0, 0, 0, 0, 0, 0, 0);
case 1: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -1849.25, -135.0, 12.0, 90.0, 0, 0, 0, 0, 0, 0);
case 2: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1050.5, 1931.0, 10.9, 270.0, 0, 0, 0, 0, 0, 0);
}
}
}
SpawnPlayer(playerid); // Force the player to spawn at the requested coordinates
SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerRescued); // Send the player a message that using "/rescue" costs $200
// Reduce the player's money by 200
RewardPlayer(playerid, -200, 0);
return 1;
}