25.05.2018, 15:13
PHP код:
C:\Users\Umer\Downloads\NG.pwn(562) : error 017: undefined symbol "pInfo"
C:\Users\Umer\Downloads\NG.pwn(31522) : error 001: expected token: ")", but found "["
C:\Users\Umer\Downloads\NG.pwn(31522) : error 029: invalid expression, assumed zero
C:\Users\Umer\Downloads\NG.pwn(31522) : warning 215: expression has no effect
C:\Users\Umer\Downloads\NG.pwn(31522) : error 001: expected token: ";", but found "]"
C:\Users\Umer\Downloads\NG.pwn(31522) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
PHP код:
CMD:vips(playerid, params[])
{
new vipstring[2000],count=0;
if(IsPlayerConnected(playerid))
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][pVipLevel] > 0)
{
format(vipstring, sizeof(vipstring),"{ffffff}%s%s (ID:%d)\n", vipstring, PlayerName(i), playerid);
count++;
}
}
}
ShowPlayerDialog(playerid,DIALOG_VIPS,DIALOG_STYLE_MSGBOX,"{B266FF}Online VIPs:",vipstring,"Close","");
}
if(count == 0) return SendClientMessage(playerid,-1,""chat" There are no VIP's online.");
return 1;
}
PHP код:
CMD:setvip(playerid, params[])
{
new giveplayerid, moneys1, giveplayer[25], playername[25], string[256], mon;
if (adlvl[playerid] < 6) return 0;
if (sscanf(params, "udd", giveplayerid, moneys1, mon)) return SendClientMessage2(playerid, COLOR_ORANGE, "Usage: /setvip [playerid] [level 1-3] [month]");
if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
if (moneys1 < 0 || moneys1 > 3) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid Vip level.");
if(mon < 0 || mon > 24) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid month (0 for lifetime, 24 = 2 years).");
if (Logged[giveplayerid] == 0) return SendClientMessage2(playerid, COLOR_WHITE, "Error: Player isn't logged in.");
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
if (adlvl[giveplayerid] >= adlvl[playerid] && adlvl[playerid] != 6) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: You cannot make %s as a vip member", giveplayer, "");
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
if (moneys1 == vipmember[giveplayerid])
{
format(string, 64, "%s is already V.I.P L%d.", giveplayer, moneys1);
SendClientMessage2(playerid, COLOR_WHITE, string);
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
if (moneys1 != 0)
{
dini_IntSet(AddDirFile(dir_userfiles, giveplayer), "vip", moneys1);
dini_IntSet(AddDirFile(dir_datafiles, FILE_VIPLIST), giveplayer, moneys1);
dini_IntSet(AddDirFile(dir_userfiles, giveplayer), "pskin", -1);
}
else
{
dini_Unset(AddDirFile(dir_userfiles, giveplayer), "vip");
dini_Unset(AddDirFile(dir_userfiles, giveplayer), "pskin");
dini_Unset(AddDirFile(dir_datafiles, FILE_VIPLIST), giveplayer);
dini_Set(AddDirFile(dir_userfiles, giveplayer), "ChatColor", "FFFFFF");
if (giveplayerid != playerid)
{
SendClientMessage2(giveplayerid, COLOR_WHITE, "Your VIP status has been removed.");
SendPlayerFormattedText(playerid, COLOR_YELLOW, "You have removed %s's VIP status.", giveplayer, "");
}
else SendClientMessage2(playerid, COLOR_WHITE, "You have removed your VIP status.");
}
if(mon != 0)
{
new days;
days = 30 * mon;
SetVip(giveplayerid, days);
}
else {
SetVip(giveplayerid, 0);
}
vipmember[giveplayerid] = moneys1;
if(mon != 0) {
format(string, 64, "You have been set as V.I.P L%d for %d monthes.", moneys1, mon);
SendClientMessage2(giveplayerid, COLOR_YELLOW, string);
format(string, 64, "You have set %s as V.I.P L%d for %d monthes.", giveplayer, moneys1, mon);
SendClientMessage2(playerid, COLOR_YELLOW, string);
}
else {
format(string, 64, "You have been set as V.I.P L%d for lifetime", moneys1);
SendClientMessage2(giveplayerid, COLOR_YELLOW, string);
format(string, 64, "You have set %s as V.I.P L%d for lifetime.", giveplayer, moneys1);
SendClientMessage2(playerid, COLOR_YELLOW, string);
}
if (moneys1 == 1)
{
GivePlayerMoney(giveplayerid, GetPlayerMoney(giveplayerid)+2500000);
if (giveplayerid != playerid)
{
SendClientMessage2(giveplayerid, COLOR_YELLOW, "You have been set as a VIP member Level 1.");
SendPlayerFormattedText(playerid, COLOR_YELLOW, "You have set %s as a VIP member Level 1.", giveplayer, "");
}
else SendClientMessage2(playerid, COLOR_YELLOW, "You have set yourself as a VIP member Level 1.");
return 1;
}
if (moneys1 == 2)
{
GivePlayerMoney(giveplayerid, GetPlayerMoney(giveplayerid)+5000000);
if (giveplayerid != playerid)
{
SendClientMessage2(giveplayerid, COLOR_YELLOW, "You have been set as a VIP member Level 2."); SendPlayerFormattedText(playerid, COLOR_YELLOW, "You have set %s as a VIP member Level 2.", giveplayer, "");
}
else SendClientMessage2(playerid, COLOR_YELLOW, "You have set yourself as a VIP member Level 2.");
return 1;
}
if (moneys1 == 3)
{
GivePlayerMoney(giveplayerid, GetPlayerMoney(giveplayerid)+20000000);
if (giveplayerid != playerid)
{
SendClientMessage2(giveplayerid, COLOR_YELLOW, "You have been set as a VIP DELUXE."); SendPlayerFormattedText(playerid, COLOR_YELLOW, "You have set %s as a VIP Deluxe.", giveplayer, "");
}
else SendClientMessage2(playerid, COLOR_YELLOW, "You have set yourself as a VIP Deluxe.");
return 1;
}
return 1;
}
Please fix my /vips cmd.