help me again!
#1

hi help me please


im getting this error : error 001: expected token: ";", but found "-identifier-"

Код:
CMD:prize(playerid,params[])
{
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]:you are not rcon admin");
new targetid,str[75],ammount,pname[MAX_PLAYER_NAME];
GetPlayerName(targetid);
if(sscanf(params,"ud",targetid,ammount)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]:Usage(playerid)/[Prize Money]");
if(playerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]:Player is not connected.");
if(ammount < 1000000 || ammount > 3000000) return SendClientMessage(playerid,COLOR_ERROR,"Invalid ammount Range's Are 1million to 3million");
GetPlayerMoney(targetid);
GivePlayerMoney(targetid,ammount)
format(str,sizeof(str), "You Have Recived (%d) prize money by a admin",ammount); // error line!
SendClientMessage(playerid,COLOR_CYAN,str);
format(str,sizeof(str),  "you have given %d prizemoney to (%i)",ammount,targetid);
SendClientMessage(targetid,COLOR_CYAN,str);
return 1;
}
Reply
#2

GivePlayerMoney(targetid,ammount);
U are missing ; on this line
Reply
#3

Quote:
Originally Posted by Wizzard2H
Посмотреть сообщение
GivePlayerMoney(targetid,ammount);
U are missing ; on this line
thanks. but now the money gets increase and then get changes to 0$!
Reply
#4

Код:
CMD:prize(playerid,params[])
{
	if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]:you are not rcon admin");
	new targetid,str[75],ammount,pname[MAX_PLAYER_NAME];
	if(sscanf(params,"ud",targetid,ammount)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]:Usage(playerid)/[Prize Money]");
	if(playerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]:Player is not connected.");
	if(ammount < 1000000 || ammount > 3000000) return SendClientMessage(playerid,COLOR_ERROR,"Invalid ammount Range's Are 1million to 3million");
	GetPlayerName(targetid, pname, sizeof(pname));
	GivePlayerMoney(targetid, + ammount);
	format(str,sizeof(str), "You Have Recived (%d) prize money by a admin",ammount);
	SendClientMessage(playerid,COLOR_CYAN,str);
	format(str,sizeof(str),  "you have given %d prizemoney to %s(%i)",ammount, pname, targetid);
	SendClientMessage(targetid,COLOR_CYAN,str);
	return 1;
}
Try this and let me know how it turns out.
Reply
#5

Quote:
Originally Posted by Affan
Посмотреть сообщение
Код:
CMD:prize(playerid,params[])
{
	if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]:you are not rcon admin");
	new targetid,str[75],ammount,pname[MAX_PLAYER_NAME];
	if(sscanf(params,"ud",targetid,ammount)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]:Usage(playerid)/[Prize Money]");
	if(playerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]:Player is not connected.");
	if(ammount < 1000000 || ammount > 3000000) return SendClientMessage(playerid,COLOR_ERROR,"Invalid ammount Range's Are 1million to 3million");
	GetPlayerName(targetid, pname, sizeof(pname));
	GivePlayerMoney(targetid, + ammount);
	format(str,sizeof(str), "You Have Recived (%d) prize money by a admin",ammount);
	SendClientMessage(playerid,COLOR_CYAN,str);
	format(str,sizeof(str),  "you have given %d prizemoney to %s(%i)",ammount, pname, targetid);
	SendClientMessage(targetid,COLOR_CYAN,str);
	return 1;
}
Try this and let me know how it turns out.
GivePlayerMoney(targetid, + ammount); < Do you even know what you're doing? It would give him invalid expression assumed zero error. He said his money gets increased and decreased again, he might have a server sided money system to prevent players from using money cheats.
Reply
#6

Jesus Christ did you even test that GivePlayerCode Affan?
OT: You might have something called AC_GivePlayerMoney or something like that.
Reply
#7

Lmao, I haven't slept in days. Sorry for my mistake, as the guys said above you might have an anti-cheat.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)