25.03.2019, 07:33
Hello
This is /SetVip Command
& This is OnPlayerText
& These are Enums
When i Enter SAMP and i make myself VIP
& when i chat in game VIP Tag Doesen't Show
anyone Could Help ?
This is /SetVip Command
PHP Code:
CMD:setvip(playerid, params[])
{
GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//define the playerid name
GetPlayerName(ID,pname,MAX_PLAYER_NAME);//define the other person name
if(levels == 0)
{
format(str, sizeof(str),"%s Changed Your rank %d !",Nam,levels);
SendClientMessage(ID,0xFF9900AA,str);
format(str, sizeof(str)," you changed %s Rank to %d !",pname,levels);
SendClientMessage(playerid,0xFF9900AA,str);
PlayerInfo[ID][pVip] = levels;//this sets the player level
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File, "Player's Data");
INI_WriteInt(File, "ViP Level", PlayerInfo[playerid][pVip]);
INI_Close(File);
return 1;
}
format(str, sizeof(str),"{FF0000}%s {ffffff}Changed {ffffff}your {ffffff}rank to {0066CC} %d !.",Nam,levels);
SendClientMessage(ID,0xFF9900AA,str);
format(str, sizeof(str),"{FF0000}you {FF0000}changed {15FF00}%s {FF0000}rank {FF0000}to {0066CC}%d!",pname,levels);
SendClientMessage(playerid,0xFF9900AA,str);
PlayerInfo[ID][pVip] = levels;
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File, "Player's Data");
INI_WriteInt(File, "ViP Level", PlayerInfo[playerid][pVip]);
INI_Close(File);
return 1;
}
PHP Code:
public OnPlayerText(playerid, text[])
{
if(PlayerInfo[playerid][pAdmin] == 1)
{
new pName[MAX_PLAYER_NAME], String[128], Prefix[] = "{FF2400}[King] ";
GetPlayerName(playerid, pName, 24);
format(String, sizeof(String), "%s%s%s{FFFFFF}[%d]: {FFFFFF}%s {FFFFFF}%s", Prefix, TeamColor[gTeam[playerid]], pName, playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
if(PlayerInfo[playerid][pVip] == 1)
{
new pName[MAX_PLAYER_NAME], String[128], Prefix[] = "{FF2400}[VIP+] ";
GetPlayerName(playerid, pName, 24);
format(String, sizeof(String), "%s%s%s{FFFFFF}[%d]: {FFFFFF}%s {FFFFFF}%s", Prefix, TeamColor[gTeam[playerid]], pName, playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
HideClassTextdraw(playerid);
return 1;
}
& These are Enums
PHP Code:
enum pInfo
{
pAdmin, // will save player's Admin !
pVip, // will save player's Vip !
Level,
}
PHP Code:
new PlayerInfo[MAX_PLAYERS][pInfo]; // Player Info
new text2[MAX_TEAMS][9];
new levels,vlevels,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],str[128],ID,amount;
new PlayerText:capturePlayerTextDraw[MAX_PLAYERS];
When i Enter SAMP and i make myself VIP
& when i chat in game VIP Tag Doesen't Show
anyone Could Help ?