26.04.2014, 19:21
(
Последний раз редактировалось George0305; 27.04.2014 в 17:46.
)
Hello,so i wanted to make a vip system,i wanted to edit the one by Jarnu,and use it only to create them, show to admins who is vip online,to show in stats whether is donator or not and to show a color for each one:bronze:color orange,silver grey and gold yellow and thats all.
Here`s the code:
There is some more i didn`t wrote,i thought it`s too much code,i will post if neccesary.
And the problem is that any level that i enter ingame will take it as 0 and it won`t give vip.
Thanks for reading and for your time
Here`s the code:
Код:
#define MAX_VIPL 3 #define TEAM_VIP 12
Код:
stock vRank(playerid) { new str[156]; if(PlayerInfo[playerid][pVIP] == 0) str = ("Player"); else if(PlayerInfo[playerid][pVIP] == 1) str = ("Donator Bronze"); else if(PlayerInfo[playerid][pVIP] == 2) str = ("Donator Silver"); else if(PlayerInfo[playerid][pVIP] == 3) str = ("Donator Gold"); return str; }
Код:
stock SaveLevel(playerid) { INI_Open(getACC(playerid)); INI_WriteInt("Level",PlayerInfo[playerid][pVIP]); INI_WriteString("Rank",Rank(playerid)); INI_Save(); INI_Close(); SendClientMessage(playerid, LIGHTGREEN,"VIP Level saved in accounts!"); return 1; }
Код:
new vip[MAX_PLAYERS]; new ViewVIP[MAX_PLAYERS]; new vips;
Код:
enum pInfo { pKey, pLevel, pSpawn, pAdmin, pVIP, ....
Код:
enum iInfo { iAdmin[128], iVIP[128], iMOTD[128], iPassword[128], iNeedPass, iLock, iPlayers, };
Код:
public OnPlayerConnect(playerid) { vip[playerid] = 0; PlayerInfo[playerid][pVIP] = 0;
Код:
public OnGameModeInit { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && playerid != i) { if(PlayerInfo[i][pVIP] > 1) { SendClientMessage(i,COLOR_GREEN,string); if(SendIP == 1) { SendClientMessage(i,COLOR_GREEN,string2); SendIP = 0; } } } }
Код:
public VIPLog(string[]) { new entry[200]; format(entry, sizeof(entry), "%s\r\n",string); new File:hFile; hFile = fopen("LARP/Logs/vips.log", io_append); fwrite(hFile, entry); fclose(hFile); }
Код:
public VIPChatLog(string[]) { new entry[200]; format(entry, sizeof(entry), "%s\r\n",string); new File:hFile; hFile = fopen("LARP/Logs/vipchat.log", io_append); fwrite(hFile, entry); fclose(hFile); }
Код:
format(coordsstring, sizeof(coordsstring), "| Level: %d | Sex: %s | Varsta: %d | Bani: $%d | Banca: $%d | Ph: %d | Regular Rank: %s | Donator:", level,atext,age,cash,account,pnumber,drank,pVIP);
Код:
dini_IntSet(string3, "VIPLevel",PlayerInfo[playerid][pVIP]);
Код:
if (strcmp(cmd, "/vips", true) == 0) // By George { if(IsPlayerAdmin(playerid)) { new count = 0; new string[256]; new name[MAX_PLAYER_NAME]; SendClientMessage(playerid, COLOR_GREEN," "); SendClientMessage(playerid, COLOR_GREEN,"Donatori online:"); for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerConnected(i)) { GetPlayerName(i, name, sizeof(name)); if(PlayerInfo[i][pVIP] >= 1) { format(string, sizeof(string),"Donator Level - %d: %s ", PlayerInfo[playerid][pVIP],name); SendClientMessage(playerid, COLOR_PURPLE, string); count++; } } } if(count == 0) { SendClientMessage(playerid, GREEN,"Niciun donator online."); } } return 1; } if (strcmp(cmd, "/setvip", true) == 0) // By George { if(IsPlayerAdmin(playerid)) { new string[125]; new level; new player1; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "Foloseste: /setvip level player"); return 1; } if(!IsPlayerConnected(playerid) && player1 != INVALID_PLAYER_ID) { SendClientMessage(playerid, RED,"[ERROR]: Player is not connected"); } if(level > MAX_VIPL) { SendClientMessage(playerid, RED,"[ERROR]: Incorrect level"); } else { format(string, sizeof(string),"Administrator '%s' has set your vip level to '%d'", PlayerName(playerid),level); SendClientMessage(player1, COLOR_PURPLE, string); PlayerPlaySound(player1,1057,0.0,0.0,0.0); PlayerInfo[player1][pVIP] = level; } } else return SendClientMessage(playerid, RED,"[ERROR]: You need to be RCON admin to use this command"); return 1; }
And the problem is that any level that i enter ingame will take it as 0 and it won`t give vip.
Thanks for reading and for your time
