14.10.2011, 16:25
Intenta asн:
pawn Код:
if (strcmp("/setvip", cmdtext, true) == 0)
{
if (IsPlayerAdmin(playerid))
{
new tmp1[128], tmp2[128], jugador, usador, string1[256], string2[256], nombreusador[MAX_PLAYER_NAME], nombrejugador[MAX_PLAYER_NAME], archivo[256];
strcat(tmp1, strtok(cmdtext, idx));
strcat(tmp2, strtok(cmdtext, idx));
if (!strlen(tmp1) || !strlen(tmp2)) return SendClientMessage(playerid, COLOR_ROJO, "[Error] Usa: /setvip [ID] [DEL 0 AL 4].");
jugador = strval(tmp1);
usador = playerid;
if (IsPlayerConnected(jugador))
{
if (strval(tmp2) < 0 || strval(tmp2) > 4) return SendClientMessage(playerid, COLOR_ROJO, "[Error]: El nivel V.I.P es solo entre 0 y 4.");
if(strval(tmp2) == Informacion[jugador][Premium]) return SendClientMessage(playerid, COLOR_ROJO, "[Error]: El jugador ya tiene ese nivel V.I.P.");
GetPlayerName(jugador, nombrejugador, MAX_PLAYER_NAME);
GetPlayerName(usador, nombreusador, MAX_PLAYER_NAME);
format(string1, 256, "[Admin] %s Te Ha otorgado una cuenta V.I.P de nivel : %d.", nombreusador,strval(tmp2));
format(string2, 256, "[Admin] Has otorgado una cuenta V.I.P de nivel : %d a %s.", strval(tmp2), nombrejugador);
SendClientMessage(jugador, COLOR_VERDE_CLARO, string1);
SendClientMessage(usador, COLOR_VERDE_CLARO, string2);
PlayerPlaySound(jugador, 1057, 0.0, 0.0, 0.0);
Informacion[jugador][Premium] = strval(tmp2);
format(archivo, 256, "V.I.P/Usuarios/%s.ini", nombrejugador);
dini_IntSet(archivo, "V.I.P", strval(tmp2));
}
else return SendClientMessage(playerid, COLOR_ROJO, "[Error]: Jugador no Contectado");
}
else return SendClientMessage(playerid, COLOR_ROJO, "[Error]: Comando Solo Para Admin Rcon!");
return 1;
}