Vip not showing the names - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vip not showing the names (
/showthread.php?tid=428695)
Vip not showing the names -
DerickClark - 06.04.2013
not showing the names just showing the vip level.here the command
Код:
COMMAND:vips(playerid, params[])
{
new Count;
new str[45];
new playername[MAX_PLAYER_NAME];
SendClientMessage(playerid, -1, "Vip online:");
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(Pinfo[i][VipLevel] >= 1)
{
Count ++;
format(str, sizeof str, "%s %s",playername,VipName(i));
SendClientMessage(playerid, -1, str);
}
}
if(Count < 1) SendClientMessage(playerid, -1, "No Vip Online!");
// Let the server know that this was a valid command
return 1;
}
Re: Vip not showing the names -
BigGroter - 06.04.2013
You never got the player's name.
edit:
try this
pawn Код:
COMMAND:vips(playerid, params[])
{
new Count;
new str[45];
new playername[MAX_PLAYER_NAME];
SendClientMessage(playerid, -1, "Vip online:");
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(Pinfo[i][VipLevel] >= 1)
{
Count ++;
GetPlayerName(i, playername, sizeof(playername));
format(str, sizeof(str), "%s %s",playername,VipName(i));
SendClientMessage(playerid, -1, str);
}
}
if(Count < 1) SendClientMessage(playerid, -1, "No Vip Online!");
// Let the server know that this was a valid command
return 1;
}
Re: Vip not showing the names -
judothijs - 06.04.2013
your format is wrong, put bracket at sizeof, and remove the pragma.
and first actually get the player's name before formatting it.
Re: Vip not showing the names -
DerickClark - 06.04.2013
Can you give me the code?
Re: Vip not showing the names -
BigGroter - 06.04.2013
Did you even bother trying mine?
Re: Vip not showing the names -
DerickClark - 06.04.2013
Yes,Thanks.it work.