Message doesn't showup - 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: Message doesn't showup (
/showthread.php?tid=540168)
Message doesn't showup -
ChandraLouis - 03.10.2014
pawn Код:
CMD:vips(playerid, params[])
{
new adminstring[128];
if(IsPlayerConnected(playerid))
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][pVIP] > 0)
{
format(adminstring, sizeof(adminstring),"Name : "COL_GREEN"%s - Level : "COL_GREEN"%d - Rank : "COL_GREEN"%s\n", PlayerName(i), pInfo[i][pVIP], GetVIPName(i));
}
}
ShowPlayerDialog(playerid,DIALOG_VIPS,DIALOG_STYLE_MSGBOX,"Online V.I.Ps",adminstring,"Close","");
}
}
else return SendClientMessage(playerid,-1,"No V.I.P.s Online.");
return 1;
}
There are no VIPs online but the "No V.I.P.s Online." message won't showup.
Can anyone help ?
Re: Message doesn't showup -
Sawalha - 03.10.2014
man you are checking if the who used the command is connected ..
Fix:
pawn Код:
CMD:vips(playerid, params[])
{
new adminstring[128];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][pVIP] > 0)
{
format(adminstring, sizeof(adminstring),"Name : "COL_GREEN"%s - Level : "COL_GREEN"%d - Rank : "COL_GREEN"%s\n", PlayerName(i), pInfo[i][pVIP], GetVIPName(i));
ShowPlayerDialog(playerid,DIALOG_VIPS,DIALOG_STYLE_MSGBOX,"Online V.I.Ps",adminstring,"Close","");
}
}
else return SendClientMessage(playerid,-1,"No V.I.P.s Online.");
}
return 1;
}
Re: Message doesn't showup -
IceBilizard - 03.10.2014
pawn Код:
CMD:vips(playerid, params[])
{
new count=0;
new adminstring[128];
if(IsPlayerConnected(playerid))
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][pVIP] > 0)
{
format(adminstring, sizeof(adminstring),"Name : "COL_GREEN"%s - Level : "COL_GREEN"%d - Rank : "COL_GREEN"%s\n", PlayerName(i), pInfo[i][pVIP], GetVIPName(i));
count++;
}
}
ShowPlayerDialog(playerid,DIALOG_VIPS,DIALOG_STYLE_MSGBOX,"Online V.I.Ps",adminstring,"Close","");
}
}
if (count == 0)
SendClientMessage(playerid,COLOR_GREY,"There are no VIPS Online at the moment");
return 1;
}