22.11.2016, 12:29
Quote:
Queria saber como faz o cmd /setkills e /setdeaths para Gamemode de mata mata
|
Код:
enum E_INFO { pMatou, pMorreu } new pInfo[MAX_PLAYERS][E_INFO]; public OnPlayerDeath(playerid, killerid, reason) { if(killerid != INVALID_PLAYER_ID) { ++ pInfo[killerid][pMatou]; } ++ pInfo[playerid][pMorreu]; return true; } CMD:setkills(playerid, params[]) { new Player, Kills, Str[128], Nome[24]; if(sscanf(params, "ud", Player, Kills)) return SendClientMessage(playerid, -1, "/setkills [id/nome] [quantia]"); if(!IsPlayerConnected(Player)) return SendClientMessage(playerid, -1, "Jogador nгo conectado."); pInfo[playerid][pMorreu] = Kills; GetPlayerName(Player, Nome, 24); format(Str, 128, "Vocк alterou a quantia de kills do jogador %s para %d", Nome, Kills); SendClientMessage(playerid, -1, Str); return true; } CMD:setdeaths(playerid, params[]) { new Player, Deaths, Str[128], Nome[24]; if(sscanf(params, "ud", Player, Deaths)) return SendClientMessage(playerid, -1, "/setdeaths [id/nome] [quantia]"); if(!IsPlayerConnected(Player)) return SendClientMessage(playerid, -1, "Jogador nгo conectado."); pInfo[playerid][pMatou] = Deaths; GetPlayerName(Player, Nome, 24); format(Str, 128, "Vocк alterou a quantia de deaths do jogador %s para %d", Nome, Deaths); SendClientMessage(playerid, -1, Str); return true; }