26.03.2015, 08:03
Hello , I have a a Dialog for weapons , I.e DIALOG_WEAPONS and I made one more for SPawn , DIALOG_TELES
I made the dialog like this and it's working ..
And i want to add this in this
But i can't Add these both.. Anyone can help?
I made the dialog like this and it's working ..
Код:
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]); } } } }