09.09.2013, 21:57
Bom a falta de atenзгo foi fatal neste caso.
VIPLevelName nгo e uma variavel de numeros e sim para amarzenamento de celulas.
Tente assim:
VIPLevelName nгo e uma variavel de numeros e sim para amarzenamento de celulas.
Tente assim:
PHP код:
COMMAND:darvip(playerid, params[])
{
new OtherPlayer, Name[24], AdminName[24], Msg[128], OldLevel, NewVIPLevel;
SendAdminText(playerid, "/darvip", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 6)
{
if (sscanf(params, "ud", OtherPlayer, NewVIPLevel)) SendClientMessage(playerid, 0xFF0000AA, "[USE] \"/darvip <ID> <Nivel VIP>\"");
else
{
if (IsPlayerConnected(OtherPlayer))
{
OldLevel = APlayerData[OtherPlayer][VIPLevel];
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(OtherPlayer, Name, sizeof(Name));
APlayerData[OtherPlayer][VIPLevel] = NewVIPLevel;
format(Msg, 128, "Voce ganhou %d por %s (%s)", VIPLevelName[APlayerData[playerid][VIPLevel]], AdminName, AdminLevelName[APlayerData[playerid][PlayerLevel]]);
SendClientMessage(OtherPlayer, 0x00FF00FF, Msg);
format(Msg, 128, "Voce deu %d ao jogador %s", VIPLevelName[APlayerData[playerid][VIPLevel]], Name);
SendClientMessage(playerid, 0x00FF00FF, Msg);
PlayerFile_Save(OtherPlayer);
if (OldLevel != NewVIPLevel)
{
format(Msg, 128, "[VIP] O jogador %s foi promovido a vip %s pelo admin %s %s.", Name, VIPLevelName[APlayerData[playerid][VIPLevel]], AdminName, AdminLevelName[APlayerData[playerid][PlayerLevel]]);
SendClientMessageToAll(0x00FF00FF, Msg);
}
else SendClientMessage(playerid, 0xFF0000FF, "O nнvel do jogador nгo foi alterado");
}
else SendClientMessage(playerid, 0xFF0000FF, "O jogador nao esta online");
}
}
}
return 1;
}
COMMAND:vips(playerid, params[])
{
new VIPList[500], Name[24];
if (APlayerData[playerid][LoggedIn] == true)
{
for (new i; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i, Name, sizeof(Name));
if (APlayerData[i][VIPLevel] > 0)
{
format(VIPList, 500, "%sO %s й Jogador VIP. Nivel vip: %s\n", VIPList, Name, VIPLevelName[APlayerData[i][VIPLevel]]);
continue;
}
}
}
if (strlen(VIPList) > 0)
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Players Vips Online no LTB:", VIPList, "Ok", "Cancelar");
else
SendClientMessage(playerid, 0xFF0000FF, "Nenhum Player vip Online");
}
return 1;
}