Command problem
#1

Hey I try to compile and this is the command and errors :

Код:
CMD:setvip(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pShopTech] >= 1)
	{
		new string[128], giveplayerid, level, months, orderid[32];
		if(sscanf(params, "udds[32]", giveplayerid, level, months, orderid))
		{
			SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setvip [player] [level] [months] [orderID]");
			SendClientMessageEx(playerid, COLOR_GRAD3, "Available Levels: |0| None |1| Bronze |2| Silver |4| Platinum |5| Moderator");
			return 1;
		}

		if(IsPlayerConnected(giveplayerid))
		{
			if(giveplayerid != INVALID_PLAYER_ID)
			{
				if(level < 0 || level > 5)
				{
					SendClientMessageEx(playerid, COLOR_GRAD1, "VIP Level can not be below 0 or above 5!");
					return 1;
				}
				if(level == 3)
				{
				    SendClientMessage(playerid, COLOR_GRAD1, "VIP Level can not be set to 3 through this command");
				    return 1;
				}
				PlayerInfo[giveplayerid][pDonateRank] = level;
				PlayerInfo[giveplayerid][pTempVIP] = 0;
				PlayerInfo[giveplayerid][pBuddyInvited] = 0;
				new playerip[32];
				GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
				if(level == 0)
				{
					if (PlayerInfo[playerid][pAdmin] < 1337)
					{
						format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to None (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
						SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
					}
					format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to None (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
					ABroadCast(COLOR_LIGHTRED,string, 1337);
					format(string, sizeof(string), "Your VIP level has been set to None by Admin %s.", GetPlayerNameEx(playerid));
					SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
					PlayerInfo[giveplayerid][pTokens] = 0;

					format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to None (%d) (order #%s)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, orderid);
					Log("logs/setvip.log", string);
					return 1;
				}
				if(level == 1)
				{
					if (PlayerInfo[playerid][pAdmin] < 1337)
					{
						format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Bronze (%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level, orderid);
						SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
					}
					if(PlayerInfo[giveplayerid][pVIPM] == 0)
					{
						PlayerInfo[giveplayerid][pVIPM] = VIPM;
						VIPM++;
					}
					PlayerInfo[giveplayerid][pVIPExpire] = gettime()+2592000*months;
					format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Bronze (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
					ABroadCast(COLOR_LIGHTRED,string, 1337);
					format(string, sizeof(string), "Your VIP level has been set to Bronze by Admin %s.", GetPlayerNameEx(playerid));
					SendClientMessageEx(giveplayerid, COLOR_WHITE, string);

					format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to Bronze (%d) (order #%s)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, orderid);
					Log("logs/setvip.log", string);
					return 1;
				}
				if(level == 2)
				{
					if (PlayerInfo[playerid][pAdmin] < 1337)
					{
						format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Silver (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
						SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
					}
					if(PlayerInfo[giveplayerid][pVIPM] == 0)
					{
						PlayerInfo[giveplayerid][pVIPM] = VIPM;
						VIPM++;
					}
					PlayerInfo[giveplayerid][pVIPExpire] = gettime()+2592000*months;
					format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Silver (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
					ABroadCast(COLOR_LIGHTRED,string, 1337);
					format(string, sizeof(string), "Your VIP level has been set to Silver by Admin %s.", GetPlayerNameEx(playerid));
					SendClientMessageEx(giveplayerid, COLOR_WHITE, string);

					format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to Silver (%d) (order #%s)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, orderid);
					Log("logs/setvip.log", string);
					return 1;
				}
				if(level == 3)
				{
				    if(!GetPVarType(playerid, "ConfirmGold")) {
				        SendClientMessageEx(playerid, COLOR_WHITE, "You are about to set someone's vip level to gold. If this is a gold vip order please use the new system.");
				        SendClientMessageEx(playerid, COLOR_WHITE, "For a new purchase of Gold Vip use(/newgvip).For renewals use(/renewgvip). If you wish to continue using this command type it again(/setvip)");
				        SetPVarInt(playerid, "ConfirmGold", 1);
				    }
				    else {
				        DeletePVar(playerid, "ConfirmGold");
						if (PlayerInfo[playerid][pAdmin] < 1337)
						{
							format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Gold (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
							SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
						}
						if(PlayerInfo[giveplayerid][pVIPM] == 0)
						{
						    PlayerInfo[giveplayerid][pVIPM] = VIPM;
							VIPM++;
						}
						PlayerInfo[giveplayerid][pVIPExpire] = gettime()+2592000*months;
						format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Gold (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
						ABroadCast(COLOR_LIGHTRED,string, 1337);
						format(string, sizeof(string), "Your VIP level has been set to Gold by Admin %s.", GetPlayerNameEx(playerid));
						SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
						format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to Gold (%d) (order #%s)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, orderid);
						Log("logs/setvip.log", string);
						return 1;
					}
				}
				if(level == 4)
				{
					if (PlayerInfo[giveplayerid][pAdmin] < 1337)
					{
						format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Platinum (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
						SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
					}
					if(PlayerInfo[giveplayerid][pVIPM] == 0)
					{
					   	PlayerInfo[giveplayerid][pVIPM] = VIPM;
						VIPM++;
					}
					format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Platinum (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
					ABroadCast(COLOR_LIGHTRED,string, 1337);
					format(string, sizeof(string), "Your VIP level has been set to Platinum by Admin %s.", GetPlayerNameEx(playerid));
					SendClientMessageEx(giveplayerid, COLOR_WHITE, string);

					// Level 5 Arms Job - Platinum VIP
					PlayerInfo[giveplayerid][pArmsSkill] = 401;

					format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to Platinum (%d) (order #%s)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, orderid);
					Log("logs/setvip.log", string);
					return 1;
				}
				if(level == 5)
				{
					if (PlayerInfo[playerid][pAdmin] < 1337)
					{
						format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Moderator (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
						SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
					}
					if(PlayerInfo[giveplayerid][pVIPM] == 0)
					{
					    PlayerInfo[giveplayerid][pVIPM] = VIPM;
						VIPM++;
					}
					format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Moderator (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
					ABroadCast(COLOR_LIGHTRED,string, 1337);
					format(string, sizeof(string), "Your VIP level has been set to Moderator by Admin %s.", GetPlayerNameEx(playerid));
					SendClientMessageEx(giveplayerid, COLOR_WHITE, string);

					format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to Moderator (%d) (order #%s)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, orderid);
					Log("logs/setvip.log", string);
					return 1;
				}
			}
			Misc_Save();
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
	}
	return 1;
}
Код:
d:\Users\User\Desktop\IC-RP.pwn(68693) : error 012: invalid function call, not a valid address
d:\Users\User\Desktop\IC-RP.pwn(68693) : error 029: invalid expression, assumed zero
This line is the line of

}
}
Misc_Save();
}
}


Somone can send the new cmd fixed ?
Reply
#2

did you define misc_save?

something like:
Код:
Misc_Save () {
     ...

     return 1; }
Reply
#3

I dont know...
Reply
#4

CTRL + F stock Misc_Save, tell us if you find anything.
Reply
#5

I should make this news :
Код:
//setvip time limited
new pVIPExpire;
new pVIPM;
new VIPM;
new ini_SetInteger;
new iRewardPlay;
new ini_SetString;
new RaceTotalLaps;
And this is errors of stock and the Setvip new one tell me whats wrong:

Код:
d:\Users\User\Desktop\IC-RP.pwn(1466) : error 012: invalid function call, not a valid address
d:\Users\User\Desktop\IC-RP.pwn(1466) : warning 215: expression has no effect
d:\Users\User\Desktop\IC-RP.pwn(1466) : warning 215: expression has no effect
d:\Users\User\Desktop\IC-RP.pwn(1466) : warning 215: expression has no effect
d:\Users\User\Desktop\IC-RP.pwn(1466) : warning 215: expression has no effect
d:\Users\User\Desktop\IC-RP.pwn(1466) : error 001: expected token: ";", but found ")"
d:\Users\User\Desktop\IC-RP.pwn(1466) : error 029: invalid expression, assumed zero
d:\Users\User\Desktop\IC-RP.pwn(1466) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

I could not understand you, sorry.
Did you post the entire Misc_Save stock? If not, please post it all.
If yes.. I can not understand it, sorry.
Reply
#7

Yes and this is the - new I added on script in the first window and the second is the errors after compile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)