02.05.2018, 10:13
Anyone know what's problem with this dialog? My server crashes after i choose any listitem In-Game.
Код:
if(dialogid == DIALOG_MEDICINE) { if(!response) return 1; switch(listitem) { case 0: { if(PlayerInfo[playerid][pAspirin] < 1) { SendClientMessageEx(playerid, COLOR_WHITE, "Anda tidak mempunyai obat Aspirin"); return 1; } SetPVarInt(playerid, "UseAspirin") == 1; PlayerInfo[playerid][pAspirin] -= 1; SendClientMessageEx(playerid, COLOR_WHITE, "Anda telah meminum sebutir obat Aspirin"); } case 1: { if(PlayerInfo[playerid][pParacetamol] < 1) { SendClientMessageEx(playerid, COLOR_WHITE, "Anda tidak mempunyai obat Paracetamol"); return 1; } SetPVarInt(playerid, "UseParacetamol") == 1; PlayerInfo[playerid][pParacetamol] -= 1; SendClientMessageEx(playerid, COLOR_WHITE, "Anda telah meminum sebutir obat Paracetamol"); } case 2: { if(PlayerInfo[playerid][pMylanta] < 1) { SendClientMessageEx(playerid, COLOR_WHITE, "Anda tidak mempunyai obat Mylanta"); return 1; } SetPVarInt(playerid, "UseMylanta") == 1; PlayerInfo[playerid][pMylanta] -= 1; SendClientMessageEx(playerid, COLOR_WHITE, "Anda telah meminum sebutir obat Mylanta"); } case 3: { if(PlayerInfo[playerid][pAspirin] < 1) { SendClientMessageEx(playerid, COLOR_WHITE, "Anda tidak mempunyai obat Buscopan Plus"); return 1; } SetPVarInt(playerid, "UseBuscopan") == 1; PlayerInfo[playerid][pBuscopan] -= 1; SendClientMessageEx(playerid, COLOR_WHITE, "Anda telah meminum sebutir obat Buscopan Plus"); } } }