SA-MP Forums Archive
VIP GetPlayerName help - 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 GetPlayerName help (/showthread.php?tid=282136)



VIP GetPlayerName help - [M.A]Angel[M.A] - 09.09.2011

Hello , i have luxadmin system and i update it and add new cmds but when i type /vips its just shaw Id of vip and level and i want it to show his Name and Level Example:

Quote:

GetPlayerName...
VIPs: %s[Level %d] , pName , Rank

This is cmd in luxadmin

Quote:

dcmd_vips(playerid,params[])
{
#pragma unused params
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 0)
{
new bool:First2 = false;
new Count, i;
new string[128];
new adminname[MAX_PLAYER_NAME];
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && AccInfo[i][pVip] > 0)
Count++;

if(Count == 0)
return SendClientMessage(playerid,yellow, "No VIPs online, try to donate your self.");

for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && AccInfo[i][pVip] > 0)
{
if(AccInfo[i][pVip] > 0)
{
switch(AccInfo[i][pVip])
{
case 1: AccType = "Free";
case 2: AccType = "Casher";
case 3: AccType = "Gold Casher";
}
}
GetPlayerName(i, adminname, sizeof(adminname));
if(!First2)
{
format(string, sizeof(string), "VIPs: %d(%s)", i,AccType);
First2 = true;
}
else format(string,sizeof(string),"%s, %d(%s)",string,i,AccType);
}
return SendClientMessage(playerid,yellow,string);
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,yellow,"No VIPs online, try to donate your self.");
}
Thanks !


Re: VIP GetPlayerName help - Jafet_Macario - 09.09.2011

Well, maybe
PHP Code:
format(stringsizeof(string), "VIPs: %s [Level: %s]"adminnameAccType); 



Re: VIP GetPlayerName help - [M.A]Angel[M.A] - 10.09.2011

Not working :S


Re: VIP GetPlayerName help - Wesley221 - 10.09.2011

pawn Code:
format(string, sizeof(string), "VIPs: %s [Level: %s]", GetName(i), AccType);
pawn Code:
stock GetName(playerid)
{
    new name[24];
    GetPlayerName(playerid, name, 24);
    return name;
}