19.03.2010, 20:22
o que eu presiso para criar um comando /setlevel ajuda aew pf
Originally Posted by marcio147
quer que eu mande meu sistema de level?
|
if(strcmp(cmd,"/setlevel", true)==0)
{
if(IsPlayerAdmin(playerid)){
new aname[MAX_PLAYER_NAME];
new tmp[256];
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "Digite: /setlevel [id] [level]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /setlevel [id] [level]");
return 1;
}
skin = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
if(IsPlayerConnected(plid)){
format(string, sizeof(string), "* O Administrador %s (%d) te setou %d Level.", aname, playerid, skin);
SendClientMessage(plid, tcadm, string);
format(string, sizeof(string), "Vocк deu a %s(ID: %d) %d Level.", pname, plid, skin);
SendClientMessage(playerid, Blue, string);
} else {
SendClientMessage(playerid, Vermelho,"{FFFF00}[{FF0000} ERRO{FFFF00} ]{FFFFFF}: Jogador nгo conectado.");
}
} else {
SendClientMessage(playerid, Vermelho,"{FFFF00}[{FF0000} ERRO{FFFF00} ]{FFFFFF}: Vocк nгo pode usar este comando.");
}
return 1;
}
if(strcmp(cmd,"/setlevel", true)==0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"voce nao e adm.rsrss");
tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, -1, "ERROR: /setlevel ID lvl.");
new id = ReturnUser(tmp); if(!IsPlayerConnected(id)) SendClientMessage(playerid, -1,"ele nao ta on aff");
tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, -1, "ERROR: /setlevel ID lvl.");
new score = strval(tmp);
SetPlayerScore(id, score);
new string[0x3C*2];
format(string, sizeof(string), "aff o adm seto seu level pra %i blz? [adm id %i]", score, playerid);
SendClientMessage(id, -1, string);
return 0x01;
}
dcmd_setlevel(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new ID, level;
if(sscanf(params, "ii", ID, level)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setlevel [id] [level]");
else if(ID == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "Player is not connected!");
else
{
AccountInfo[ID][aLevel] = level;
SendClientMessage(ID, COLOR_GREEN, "The RCON Admin promoted you to an admin!");
}
}
return 1;
}
pawn Код:
|
CMD:daradmin(playerid, params[])
{
static
Jogador2[ MAX_PLAYER_NAME ],
Jogador[ MAX_PLAYER_NAME ],
sStr[ 128 ],
Reacao,
id;
if( !IsPlayerAdmin( playerid ) )
return SendClientMessage( playerid, 0xFFF000AA, "[Admin] Vocк nгo tem permissгo para usar este comando!" );
if( sscanf( params, "ud", id, Reacao ) )
return SendClientMessage( playerid, 0xFFF000AA, "Uso correto: /setlevel [ID] [Level]" );
if( !IsPlayerConnected( id ) )
return SendClientMessage( playerid, 0xFFF000AA, "Jogador nгo conectado!" );
GetPlayerName( playerid, Jogador, sizeof( Jogador ) );
GetPlayerName( id, Jogador2, sizeof( Jogador2 ) );
format( sStr, sizeof( sStr ), "[Admin] Administrador %s promoveu-te a nнvel %d", Jogador, Reacao );
SendClientMessage( id, 0xFFF000AA, sStr );
format( sStr, sizeof( sStr ), "[Admin] Vocк colocou %s com nнvel %d", Jogador2, Reacao );
SendClientMessage( playerid, 0xFFF000AA, sStr );
SetPlayerScore( id, Reacao );
return true;
}