21.08.2016, 23:25
Estou com um problema, quando digito o comando o dialog atй a aparece, mas quando eu executo uma aзгo ele nгo funciona. Alguйm saberia me explicar o que estб errado?
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/Shop", cmdtext, true, 10) == 0) { new str[64] = "Nitro2x\nNitro5x\nNitro10x\nReparar"; ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Shopping", str, "Selecionar", "Cancelar"); } return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new string[128]; if(dialogid == 0) { if(response) { GivePlayerMoney(playerid, -750); new component; component = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_NITRO); if (component == 1009) { SendClientMessage(playerid,0xFFFFFFFF,"Vocк comprou o Nitro!"); } else if(listitem == 1) { GivePlayerMoney(playerid, -750); new component; component = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_NITRO); if (component == 1008) { SendClientMessage(playerid,0xFFFFFFFF,"Vocк comprou o Nitro!"); } return 1; } else if(listitem == 2) { GivePlayerMoney(playerid, -1050); new component; component = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_NITRO); if (component == 1010) { SendClientMessage(playerid,0xFFFFFFFF,"Vocк comprou o Nitro!"); return 1; } else if(listitem == 3) { RepairVehicle(GetPlayerVehicleID(playerid)); GivePlayerMoney(playerid, -200); SendClientMessage(playerid,0xFFFFFFFF,"Vocк reparou o Carro!"); return 1; } } } return 1; } return 0; } stock PlayerName(playerid) { new Nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, Nome, MAX_PLAYER_NAME); return Nome; }