30.03.2019, 12:29
(
Последний раз редактировалось Hatiro; 30.03.2019 в 13:18.
)
nгo sei se a causa de todos й o "strcmp"
codigo:
codigo completo:
https://pastebin.com/er2TttKL
https://prnt.sc/n528w3
includes:
a_samp + dini
codigo:
Код:
public OnPlayerCommandText(playerid, cmd[]) { new tmp[128]; if(strcmp(cmd, "/convidar", true) == 0) { tmp = strtok(cmd, idx); new PlayerB; if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /convidar [id]"); PlayerB = strval(tmp); if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado"); if(PlayerInfo[playerid][PMilitar] >= 6) { PlayerInfo[PlayerB][PMilitar] = 1; SendClientMessage(PlayerB, Branco, "Vocк entrou а Polнcia Militar"); SetPlayerColor(PlayerB, Cor_PMilitar); return 1; } else if(PlayerInfo[playerid][Groove] >= 6) { PlayerInfo[PlayerB][Groove] = 1; SendClientMessage(PlayerB, Branco, "Vocк entrou а Groove"); SetPlayerColor(PlayerB, Cor_Groove); return 1; } else if(PlayerInfo[playerid][Ballas] >= 6) { PlayerInfo[PlayerB][Ballas] = 1; SendClientMessage(PlayerB, Branco, "Vocк entrou aos Ballas"); SetPlayerColor(PlayerB, Cor_Ballas); return 1; } return 0; } if(strcmp(cmd, "/promover", true) == 0) { tmp = strtok(cmdtext, idx); new PlayerB, level; if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]"); PlayerB = strval(tmp); if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado"); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]"); level = strval(tmp); if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7"); new string[128], promovedor[MAX_PLAYER_NAME]; GetPlayerName(playerid, promovedor, sizeof(promovedor)); if(PlayerInfo[playerid][PMilitar] >= 6) { if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org"); PlayerInfo[PlayerB][PMilitar] = level; format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);); SendClientMessage(PlayerB, Branco, string); return 1; } else if(PlayerInfo[playerid][Groove] >= 6) { if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org"); PlayerInfo[PlayerB][Groove] = level; format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);); SendClientMessage(PlayerB, Branco, string); return 1; } else if(PlayerInfo[playerid][Ballas] >= 6) { if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org"); PlayerInfo[PlayerB][Ballas] = level; format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);); SendClientMessage(PlayerB, Branco, string); return 1; } return 0; } if(strcmp(cmd, "/demitir", true) == 0) { tmp = strtok(cmdtext, idx); new PlayerB, string[128], demitidor[MAX_PLAYER_NAME]; if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /demitir [id]"); PlayerB = strval(tmp); GetPlayerName(playerid, demitidor, sizeof(demitidor)); if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado"); if(PlayerInfo[playerid][PMilitar] >= 6) { if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo"); PlayerInfo[PlayerB][PMilitar] = 0; format(string, sizeof(string), "Vocк foi demitido por %s", demitidor); SendClientMessage(PlayerB, Branco, string); return 1; } else if(PlayerInfo[playerid][Groove] >= 6) { if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo"); PlayerInfo[PlayerB][Groove] = 0; format(string, sizeof(string), "Vocк foi demitido por %s", demitidor); SendClientMessage(PlayerB, Branco, string); return 1; } else if(PlayerInfo[playerid][Ballas] >= 6) { if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo"); PlayerInfo[PlayerB][Ballas] = 0; format(string, sizeof(string), "Vocк foi demitido por %s", demitidor); SendClientMessage(PlayerB, Branco, string); return 1; } return 0; }
https://pastebin.com/er2TttKL
https://prnt.sc/n528w3
includes:
a_samp + dini