Ajuda vip -
Canema - 09.09.2013
Bom vim aqui pedir ajuda pois o meu /darvip eu do certinho mais tipo ele da este bug vou deixar o print abaixo.
pawn Код:
COMMAND:darvip(playerid, params[])
{
// Setup local variables
new OtherPlayer, Name[24], AdminName[24], Msg[128], OldLevel, NewVIPLevel;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/darvip", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 5
if (APlayerData[playerid][PlayerLevel] >= 6)
{
if (sscanf(params, "ui", OtherPlayer, NewVIPLevel)) SendClientMessage(playerid, 0xFF0000AA, "[USE] \"/darvip <ID> <Nivel VIP>\"");
else
{
// Check if that other player is online
if (IsPlayerConnected(OtherPlayer))
{
OldLevel = APlayerData[OtherPlayer][VIPLevel];
// Get the playername of the admin
GetPlayerName(playerid, AdminName, sizeof(AdminName));
// Also get the name of the player that has been promoted
GetPlayerName(OtherPlayer, Name, sizeof(Name));
// Store the level of the player
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)
{
// Check if the player has been promoted or demoted
format(Msg, 128, "[VIP] O jogador %s foi promovido a vip nivel %d pelo admin %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");
}
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Print : imgur.com/MIaB69X
Re: Ajuda vip -
smiiir - 09.09.2013
Tenta agora
pawn Код:
COMMAND:darvip(playerid, params[])
{
// Setup local variables
new OtherPlayer, Name[24], AdminName[24], Msg[128], OldLevel, NewVIPLevel;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/darvip", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 5
if (APlayerData[playerid][PlayerLevel] >= 6)
{
if (sscanf(params, "ud", OtherPlayer, NewVIPLevel)) SendClientMessage(playerid, 0xFF0000AA, "[USE] \"/darvip <ID> <Nivel VIP>\"");
else
{
// Check if that other player is online
if (IsPlayerConnected(OtherPlayer))
{
OldLevel = APlayerData[OtherPlayer][VIPLevel];
// Get the playername of the admin
GetPlayerName(playerid, AdminName, sizeof(AdminName));
// Also get the name of the player that has been promoted
GetPlayerName(OtherPlayer, Name, sizeof(Name));
// Store the level of the player
APlayerData[OtherPlayer][VIPLevel] = NewVIPLevel;
format(Msg, 128, "Voce ganhou %d por %s (%s)", NewVIPLevel, AdminName, AdminLevelName[APlayerData[playerid][PlayerLevel]]);
SendClientMessage(OtherPlayer, 0x00FF00FF, Msg);
format(Msg, 128, "Voce deu %d ao jogador %s", NewVIPLevel, Name);
SendClientMessage(playerid, 0x00FF00FF, Msg);
PlayerFile_Save(OtherPlayer);
if (OldLevel != NewVIPLevel)
{
// Check if the player has been promoted or demoted
format(Msg, 128, "[VIP] O jogador %s foi promovido a vip nivel %d pelo admin %s", Name, NewVIPLevel, 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");
}
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Re: Ajuda vip -
Canema - 09.09.2013
Foi mais surgiu mais um problema !
http://imgur.com/8Mxh7FI
Re: Ajuda vip -
smiiir - 09.09.2013
Mande o comando /vips sei lб como que olha
Re: Ajuda vip -
Canema - 09.09.2013
pawn Код:
COMMAND:vips(playerid, params[])
{
new VIPList[500], Name[24];
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Scan through all players
for (new i; i < MAX_PLAYERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
// Get the name of the player
GetPlayerName(i, Name, sizeof(Name));
//Check if that player is an admin (using the PlayerLevel)
if (APlayerData[i][VIPLevel] > 0)
{
// Add all admin players to the list
format(VIPList, 500, "O %s й Jogador VIP. Nivel vip: %d\n", VIPList, Name, VIPLevelName[APlayerData[i][VIPLevel]]);
continue;
}
}
}
// Check if there were admin-names added to the list
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");
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Re: Ajuda vip -
smiiir - 09.09.2013
Veja se funciona assim
pawn Код:
COMMAND:vips(playerid, params[])
{
new VIPList[500], Name[24];
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Scan through all players
for (new i; i < MAX_PLAYERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
// Get the name of the player
GetPlayerName(i, Name, sizeof(Name));
//Check if that player is an admin (using the PlayerLevel)
if (APlayerData[i][VIPLevel] > 0)
{
// Add all admin players to the list
format(VIPList, 500, "O %s й Jogador VIP. Nivel vip: %d\n", VIPList, Name, APlayerData[i][VIPLevel]);
continue;
}
}
}
// Check if there were admin-names added to the list
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");
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Re: Ajuda vip -
Canema - 09.09.2013
Ainda nгo estб dando certo,
Re: Ajuda vip -
smiiir - 09.09.2013
Tenta agora, tinha deixado uns negocio em cima
pawn Код:
COMMAND:vips(playerid, params[])
{
new VIPList[500], Name[24];
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Scan through all players
for (new i; i < MAX_PLAYERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
// Get the name of the player
GetPlayerName(i, Name, sizeof(Name));
//Check if that player is an admin (using the PlayerLevel)
if (APlayerData[i][VIPLevel] > 0)
{
// Add all admin players to the list
format(VIPList, 500, "O %s й Jogador VIP. Nivel vip: %d\n", VIPList, Name, APlayerData[i][VIPLevel]);
continue;
}
}
}
// Check if there were admin-names added to the list
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");
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Re: Ajuda vip -
Don_Speed - 09.09.2013
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:
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;
}
Re: Ajuda vip -
Canema - 09.09.2013
Ei como eu faзo pra os vips serem salvos ?