public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_WEAPONS) { if(response) { switch(listitem) { case 0: { if(GetPlayerMoney(playerid)<500) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_DEAGLE, 150); GivePlayerMoney(playerid,-500); } case 1: { if(GetPlayerMoney(playerid)<500) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_CHAINSAW , 1); GivePlayerMoney(playerid, -500); } case 2: { if(GetPlayerMoney(playerid)<500) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_SILENCED , 150); GivePlayerMoney(playerid, -500); } case 3: { if(GetPlayerMoney(playerid)<700) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_SHOTGUN , 150); GivePlayerMoney(playerid, -700); } case 4: { if(GetPlayerMoney(playerid)<1000) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_SAWEDOFF , 200); GivePlayerMoney(playerid, -1000); } case 5: { if(GetPlayerMoney(playerid)<1000) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_SHOTGSPA , 200); GivePlayerMoney(playerid, -1000); } case 6: { if(GetPlayerMoney(playerid)<800) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_MP5 , 1000); GivePlayerMoney(playerid, -800); } case 7: { if(GetPlayerMoney(playerid)<800) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_UZI , 1000); GivePlayerMoney(playerid, -800); } case 8: { if(GetPlayerMoney(playerid)<1500) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_M4 , 1000); GivePlayerMoney(playerid, -1500); } case 9: { if(GetPlayerMoney(playerid)<1500) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_AK47 , 1000); GivePlayerMoney(playerid, -1500); } case 10: { if(GetPlayerMoney(playerid)<2000) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_RIFLE , 1000); GivePlayerMoney(playerid, -2000); } case 11: { if(GetPlayerMoney(playerid)<2000) return SendClientMessage(playerid,COLOR_BLUE, " Not Enough Money to buy Gun , you choosed"); GivePlayerWeapon(playerid, WEAPON_SNIPER , 1000); GivePlayerMoney(playerid, -2000); } } } return 1; } return 0; }
if(dialogid == DIALOG_TELES) { if(response) { switch(listitem) { case 0: { new Random = random(sizeof(RandomSpawnLS)); SetPlayerPos(playerid, RandomSpawnLS[Random][0], RandomSpawnLS[Random][1], RandomSpawnLS[Random][2]); SetPlayerFacingAngle(playerid, RandomSpawnLS[Random][3]); } case 1: { new Random = random(sizeof(RandomSpawnLV)); SetPlayerPos(playerid, RandomSpawnLV[Random][0], RandomSpawnLV[Random][1], RandomSpawnLV[Random][2]); SetPlayerFacingAngle(playerid, RandomSpawnLV[Random][3]); } case 2: { new Random = random(sizeof(RandomSpawnSF)); SetPlayerPos(playerid, RandomSpawnSF[Random][0], RandomSpawnSF[Random][1], RandomSpawnSF[Random][2]); SetPlayerFacingAngle(playerid, RandomSpawnSF[Random][3]); } } } }
if(dialogid == DIALOG_WEAPONS)
{
// Code
}
else if(dialoid == DIALOG_TELES)
{
// Code
}
switch(dialogid)
{
case DIALOG_WEAPONS:
{
// Code
}
case DIALOG_TELES:
{
// Code
}
}
#include <a_samp> #include <zcmd> #define DIALOG_TELES 3 new Float:RandomSpawnLS[][] = { {1091.0786,-1794.4513,13.6197,17.5902}, {1959.8345,-2181.7620,13.5469,1.2967}, {1186.0222,-1324.5660,13.5593,267.7775}, {1316.6267,-910.7559,38.0429,178.3317}, {1126.6519,-2036.7144,69.8838,271.3926}, {2426.2029,-2457.7190,13.6201,316.5363} }; new Float:RandomSpawnLV[][] = { {1723.7269,1601.9326,10.0166,253.8372}, {2025.2045,1545.3309,10.8203,273.8063}, {2304.7341,2426.7422,10.8203,182.1671}, {2519.7900,1824.4259,10.8129,92.7213}, {2233.5547,1285.6110,10.8203,91.7813}, {1061.9387,1807.1115,10.8203,1.3443} }; new Float:RandomSpawnSF[][] = { {-1983.3813,137.4470,27.6875,88.2716}, {-2027.1277,-93.8835,35.1641,3.7260}, {-2724.3335,-314.1563,7.1869,49.9080}, {-2755.9751,375.4995,4.3350,273.4851}, {-2489.6787,1200.6038,37.1529,215.2514}, {-1508.9319,922.6257,7.1875,91.1702}, {-1555.0504,-439.7008,6.0000,137.3754} }; enum pInfo { pLS, pLV, pSF } new pData[MAX_PLAYERS][pInfo]; #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } #endif public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } CMD:Tele(playerid,params[]) { ShowPlayerDialog(playerid,DIALOG_TELES,DIALOG_STYLE_LIST,"TELES","LS\nLV\nSF","Select","Close"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_TELES) { if(response) { switch(listitem) { case 0: { new Random = random(sizeof(RandomSpawnLS)); SetPlayerPos(playerid, RandomSpawnLS[Random][0], RandomSpawnLS[Random][1], RandomSpawnLS[Random][2]); SetPlayerFacingAngle(playerid, RandomSpawnLS[Random][3]); pData[playerid][pLS] = 1; } case 1: { new Random = random(sizeof(RandomSpawnLV)); SetPlayerPos(playerid, RandomSpawnLV[Random][0], RandomSpawnLV[Random][1], RandomSpawnLV[Random][2]); SetPlayerFacingAngle(playerid, RandomSpawnLV[Random][3]); pData[playerid][pLV] = 1; } case 2: { new Random = random(sizeof(RandomSpawnSF)); SetPlayerPos(playerid, RandomSpawnSF[Random][0], RandomSpawnSF[Random][1], RandomSpawnSF[Random][2]); SetPlayerFacingAngle(playerid, RandomSpawnSF[Random][3]); pData[playerid][pSF] = 1; } } } } return 1; } public OnPlayerSpawn(playerid) { if(pData[playerid][pLS]) return new Random = random(sizeof(RandomSpawnLS)); SetPlayerPos(playerid, RandomSpawnLS[Random][0], RandomSpawnLS[Random][1], RandomSpawnLS[Random][2]); return 1; }
And Dude another error , i post it here , why to make another topic,
See this codes Код:
#include <a_samp> #include <zcmd> #define DIALOG_TELES 3 new Float:RandomSpawnLS[][] = { {1091.0786,-1794.4513,13.6197,17.5902}, {1959.8345,-2181.7620,13.5469,1.2967}, {1186.0222,-1324.5660,13.5593,267.7775}, {1316.6267,-910.7559,38.0429,178.3317}, {1126.6519,-2036.7144,69.8838,271.3926}, {2426.2029,-2457.7190,13.6201,316.5363} }; new Float:RandomSpawnLV[][] = { {1723.7269,1601.9326,10.0166,253.8372}, {2025.2045,1545.3309,10.8203,273.8063}, {2304.7341,2426.7422,10.8203,182.1671}, {2519.7900,1824.4259,10.8129,92.7213}, {2233.5547,1285.6110,10.8203,91.7813}, {1061.9387,1807.1115,10.8203,1.3443} }; new Float:RandomSpawnSF[][] = { {-1983.3813,137.4470,27.6875,88.2716}, {-2027.1277,-93.8835,35.1641,3.7260}, {-2724.3335,-314.1563,7.1869,49.9080}, {-2755.9751,375.4995,4.3350,273.4851}, {-2489.6787,1200.6038,37.1529,215.2514}, {-1508.9319,922.6257,7.1875,91.1702}, {-1555.0504,-439.7008,6.0000,137.3754} }; enum pInfo { pLS, pLV, pSF } new pData[MAX_PLAYERS][pInfo]; #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } #endif public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } CMD:Tele(playerid,params[]) { ShowPlayerDialog(playerid,DIALOG_TELES,DIALOG_STYLE_LIST,"TELES","LS\nLV\nSF","Select","Close"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_TELES) { if(response) { switch(listitem) { case 0: { new Random = random(sizeof(RandomSpawnLS)); SetPlayerPos(playerid, RandomSpawnLS[Random][0], RandomSpawnLS[Random][1], RandomSpawnLS[Random][2]); SetPlayerFacingAngle(playerid, RandomSpawnLS[Random][3]); pData[playerid][pLS] = 1; } case 1: { new Random = random(sizeof(RandomSpawnLV)); SetPlayerPos(playerid, RandomSpawnLV[Random][0], RandomSpawnLV[Random][1], RandomSpawnLV[Random][2]); SetPlayerFacingAngle(playerid, RandomSpawnLV[Random][3]); pData[playerid][pLV] = 1; } case 2: { new Random = random(sizeof(RandomSpawnSF)); SetPlayerPos(playerid, RandomSpawnSF[Random][0], RandomSpawnSF[Random][1], RandomSpawnSF[Random][2]); SetPlayerFacingAngle(playerid, RandomSpawnSF[Random][3]); pData[playerid][pSF] = 1; } } } } return 1; } public OnPlayerSpawn(playerid) { if(pData[playerid][pLS]) return new Random = random(sizeof(RandomSpawnLS)); SetPlayerPos(playerid, RandomSpawnLS[Random][0], RandomSpawnLS[Random][1], RandomSpawnLS[Random][2]); return 1; } |
if(pData[playerid][pLS])
{
new Random = random(sizeof(RandomSpawnLS));
SetPlayerPos(playerid, RandomSpawnLS[Random][0], RandomSpawnLS[Random][1], RandomSpawnLS[Random][2]);
}
#include <a_samp>
#include <zcmd>
#define DIALOG_TELES 3
new Float:RandomSpawnLS[][] =
{
{1091.0786,-1794.4513,13.6197,17.5902},
{1959.8345,-2181.7620,13.5469,1.2967},
{1186.0222,-1324.5660,13.5593,267.7775},
{1316.6267,-910.7559,38.0429,178.3317},
{1126.6519,-2036.7144,69.8838,271.3926},
{2426.2029,-2457.7190,13.6201,316.5363}
};
new Float:RandomSpawnLV[][] =
{
{1723.7269,1601.9326,10.0166,253.8372},
{2025.2045,1545.3309,10.8203,273.8063},
{2304.7341,2426.7422,10.8203,182.1671},
{2519.7900,1824.4259,10.8129,92.7213},
{2233.5547,1285.6110,10.8203,91.7813},
{1061.9387,1807.1115,10.8203,1.3443}
};
new Float:RandomSpawnSF[][] =
{
{-1983.3813,137.4470,27.6875,88.2716},
{-2027.1277,-93.8835,35.1641,3.7260},
{-2724.3335,-314.1563,7.1869,49.9080},
{-2755.9751,375.4995,4.3350,273.4851},
{-2489.6787,1200.6038,37.1529,215.2514},
{-1508.9319,922.6257,7.1875,91.1702},
{-1555.0504,-439.7008,6.0000,137.3754}
};
enum pInfo
{
pCity //Will store ID of the current city here. (Ofcousre this will need to be saved)
}
/*
1: Will be LS
2: Will be LV
3: Will be SF
*/
new pData[MAX_PLAYERS][pInfo];
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
CMD:Tele(playerid,params[])
{
ShowPlayerDialog(playerid,DIALOG_TELES,DIALOG_STYLE_LIST,"TELES","LS\nLV\nSF","Select","Close");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_TELES)
{
if(response)
{
switch(listitem)
{
case 0:
{
new Random = random(sizeof(RandomSpawnLS));
SetPlayerPos(playerid, RandomSpawnLS[Random][0], RandomSpawnLS[Random][1], RandomSpawnLS[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnLS[Random][3]);
pData[playerid][pCity] = 1;
}
case 1:
{
new Random = random(sizeof(RandomSpawnLV));
SetPlayerPos(playerid, RandomSpawnLV[Random][0], RandomSpawnLV[Random][1], RandomSpawnLV[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnLV[Random][3]);
pData[playerid][pCity] = 2;
}
case 2:
{
new Random = random(sizeof(RandomSpawnSF));
SetPlayerPos(playerid, RandomSpawnSF[Random][0], RandomSpawnSF[Random][1], RandomSpawnSF[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnSF[Random][3]);
pData[playerid][pCity] = 3;
}
}
}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
switch(pData[playerid][pCity])
{
case 1:
{
new Random = random(sizeof(RandomSpawnLS));
SetPlayerPos(playerid, RandomSpawnLS[Random][0], RandomSpawnLS[Random][1], RandomSpawnLS[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnLS[Random][3]);
}
case 2:
{
new Random = random(sizeof(RandomSpawnLV));
SetPlayerPos(playerid, RandomSpawnLV[Random][0], RandomSpawnLV[Random][1], RandomSpawnLV[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnLV[Random][3]);
}
case 3:
{
new Random = random(sizeof(RandomSpawnSF));
SetPlayerPos(playerid, RandomSpawnSF[Random][0], RandomSpawnSF[Random][1], RandomSpawnSF[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnSF[Random][3]);
}
}
return 1;
}