CMD:setscore(playerid, params[])
{
new id,score;
static stringf[90];
if(Player[playerid][Admin] < 1) return SCM(playerid, COLOR_ORANGE, MSG_CMD_WITHOUT_PERMISSION);
if(sscanf(params, "di", id, score)) return SendClientMessage(playerid, COLORT_GREY, ""TAG_USOCORRETO" /setscore [ID] [SCORE]");
if(score < 1) return SendClientMessage(playerid, COLOR_ORANGE, "Vocк precisa dar 1+ score");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ORANGE, "Jogador off");
SetPlayerScore(id, GetPlayerScore(id) + 1);
format(stringf, sizeof(stringf), "Admin: %s setou seu score", Nome(playerid));
SendClientMessage(id, COLOR_ORANGE, stringf);
SalvarDados(id);
return 1;
}
C:\Users\Lan\Desktop\Game Mode\gamemodes\Mode.pwn(7294) : error 035: argument type mismatch (argument 2)
if(sscanf(params, "di", id, score)) return SendClientMessage(playerid, CINZA, "USAGE: /setscore [ID] [SCORE]");
if(sscanf(params, "ui", id, score)) return SendClientMessage(playerid, CINZA, "USAGE: /setscore [ID] [SCORE]");
SendClientMessage(playerid, COLORT_GREY, ""TAG_USOCORRETO" /setscore [ID] [SCORE]");
CMD:setscore(playerid, params[]) { new String[130], ID, SCORE ; if(sscanf(params, "ui", ID, SCORE)) return SendClientMessage(playerid, -1, "/SetScore [ID] [SCORE]."); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Player Invбlido."); if(SCORE < 0 || SCORE > 99999) return SendClientMessage(playerid, -1, "Setagem de 0 a 99999."); if(Player[playerid][Admin] < 1) return SendClientMessage(playerid, -1, "Vocк nгo tem permissгo para usar o comando."); format(String, sizeof(String), "Admin: %s setou seu score", Nome(playerid)); SendClientMessage(ID, -1, String); SetPlayerScore(ID, GetPlayerScore(ID) + SCORE); SalvarDados(ID); return true; }
CMD:setscore(playerid, params[])
{
new id,score;
new stringf[90];
if(Player[playerid][Admin] < 1) return SCM(playerid, COLOR_ORANGE, MSG_CMD_WITHOUT_PERMISSION);
if(sscanf(params, "di", id, score)) return SendClientMessage(playerid, COLORT_GREY, "TAG_USOCORRETO" /setscore [ID] [SCORE]");
if(score < 1) return SendClientMessage(playerid, COLOR_ORANGE, "Vocк precisa dar 1+ score");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ORANGE, "Jogador off");
SetPlayerScore(id, GetPlayerScore(id) + 1);
format(stringf, sizeof(stringf), "Admin: %s setou seu score", Nome(playerid));
SendClientMessage(id, COLOR_ORANGE, stringf);
SalvarDados(id);
return 1;
}
Improvisei este aqui pra vocк:
Код:
CMD:setscore(playerid, params[]) { new String[130], ID, SCORE ; if(sscanf(params, "ui", ID, SCORE)) return SendClientMessage(playerid, -1, "/SetScore [ID] [SCORE]."); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Player Invбlido."); if(SCORE < 0 || SCORE > 99999) return SendClientMessage(playerid, -1, "Setagem de 0 a 99999."); if(Player[playerid][Admin] < 1) return SendClientMessage(playerid, -1, "Vocк nгo tem permissгo para usar o comando."); format(String, sizeof(String), "Admin: %s setou seu score", Nome(playerid)); SendClientMessage(ID, -1, String); SetPlayerScore(ID, GetPlayerScore(ID) + SCORE); SalvarDados(ID); return true; } Obs: nгo foi testado! |
Foi certinho +rep, aproveitando o topico pode me dizer como posso usar este comando й para dar /setscore ai todos que tive se online ia ganhar o score dado pelo admin
PHP код:
|
for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SetPlayerScore(i, GetPlayerScore(i) + SCORE); } }
CMD:setscoretodos(playerid, params[]) { new String[130], SCORE ; if(sscanf(params, "i", SCORE)) return SendClientMessage(playerid, -1, "/SetScore [SCORE]."); if(SCORE < 0 || SCORE > 99999) return SendClientMessage(playerid, -1, "Setagem de 0 a 99999."); if(Player[playerid][Admin] < 1) return SendClientMessage(playerid, -1, "Vocк nгo tem permissгo para usar o comando."); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SetPlayerScore(i, GetPlayerScore(i) + SCORE); } } format(String, sizeof(String), "O player %s deu %i de score para todos jogadores online.", Nome(playerid), SCORE); SendClientMessageToAll(-1, String); return true; }