21.12.2017, 14:18
CMDetvip(playerid, params[])
Its giving me error undifined symbol "GiveRMoney"
PHP код:
{
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_WHITE, "Usage: /setvip [playerid] [level 1-2] [month]");
if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
if (moneys1 < 0 || moneys1 > 2) 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 vip %s", giveplayer, "");
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
if (moneys1 == vipmember[giveplayerid])
{
format(string, 64, "%s is already Vip 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 Vip L%d for %d month(s).", moneys1, mon);
SendClientMessage2(giveplayerid, COLOR_YELLOW, string);
format(string, 64, "You have set %s as Vip L%d for %d month(s).", giveplayer, moneys1, mon);
SendClientMessage2(playerid, COLOR_YELLOW, string);
}
else {
format(string, 64, "You have been set as Vip L%d for lifetime", moneys1);
SendClientMessage2(giveplayerid, COLOR_YELLOW, string);
format(string, 64, "You have set %s as Vip L%d for lifetime.", giveplayer, moneys1);
SendClientMessage2(playerid, COLOR_YELLOW, string);
}
if (moneys1 == 1)
{
GiveRMoney(giveplayerid, GetPlayerMoney(giveplayerid)+2500000);
ppoints[giveplayerid] += 50;
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)
{
GiveRMoney(giveplayerid, GetPlayerMoney(giveplayerid)+5000000);
ppoints[giveplayerid] += 100;
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;
}
return 1;
}