[Ajuda] Sу aparece o id 0? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Sу aparece o id 0? (
/showthread.php?tid=475151)
Sу aparece o id 0? -
AndersonAq - 11.11.2013
Criei isso aqui, mas na frente do nome do player, sу mostra o id 0, sendo que meu id й outro, o que tem de errado?
PHP код:
COMMAND:participantes(playerid, params[])
{
// Setup local variables
new Name[24], MemberList[2000], Convoy;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/participantes", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the member is in a convoy
if (APlayerData[playerid][InConvoy] == true)
{
// Get the convoyID of the member
Convoy = APlayerData[playerid][ConvoyID];
// Loop through all members
for (new i; i < CONVOY_MAX_MEMBERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
if (AConvoys[Convoy][Members][i] != -1) // Check if this member-spot is occupied
{
// Get the name of the member
GetPlayerName(AConvoys[Convoy][Members][i], Name, sizeof(Name));
// Add the membernames to the list
format(MemberList, 2000, "%s%s (ID: %i)\n", MemberList, Name, i);
}
}
ShowPlayerDialog(playerid, DialogConvoyMembers, DIALOG_STYLE_MSGBOX, "Membros do comboio", MemberList, "OK", "");
}
}
else
SendClientMessage(playerid, 0xFF0000FF, "Nгo йs do comboio.");
}
else
return 0;
return 1;
}
Re: Sу aparece o id 0? -
Kimossab - 11.11.2013
Eu nao estou a perceber o que esse comando faz. Entao mas aparece o nome certo mas o ID errado ou sу aparece o do ID 0?
Explica um pouco melhor o que se passa e o que deveria se passar.
Re: Sу aparece o id 0? -
Chazika - 11.11.2013
Tenta ae
pawn Код:
COMMAND:participantes(playerid, params[])
{
// Setup local variables
new Name[24], MemberList[2000], Convoy;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/participantes", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the member is in a convoy
if (APlayerData[playerid][InConvoy] == true)
{
// Get the convoyID of the member
Convoy = APlayerData[playerid][ConvoyID];
// Loop through all members
for(new i = 0; i < CONVOY_MAX_MEMBERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
if (AConvoys[Convoy][Members][i] != -1) // Check if this member-spot is occupied
{
// Get the name of the member
GetPlayerName(AConvoys[Convoy][Members][i], Name, sizeof(Name));
// Add the membernames to the list
format(MemberList, 2000, "%s%s (ID: %i)\n", MemberList, Name, i);
}
}
ShowPlayerDialog(playerid, DialogConvoyMembers, DIALOG_STYLE_MSGBOX, "Membros do comboio", MemberList, "OK", "");
}
}
else
SendClientMessage(playerid, 0xFF0000FF, "Nгo йs do comboio.");
}
else
return 0;
return 1;
}
linha modificada
pawn Код:
for(new i = 0; i < CONVOY_MAX_MEMBERS; i++)