SA-MP Forums Archive
help me again! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help me again! (/showthread.php?tid=590940)



help me again! - ahameed4755 - 05.10.2015

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;
}



Re: help me again! - Crystallize - 05.10.2015

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


Re: help me again! - ahameed4755 - 06.10.2015

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$!


Re: help me again! - Affan - 06.10.2015

Код:
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.


Re: help me again! - Sjn - 06.10.2015

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.


Re: help me again! - J0sh... - 06.10.2015

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


Re: help me again! - Affan - 06.10.2015

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