Having Some Problems :/ - 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: Having Some Problems :/ (
/showthread.php?tid=633617)
Having Some Problems :/ -
akib - 04.05.2017
hi
I am having some problems with this code:
Код:
new date;
format(date,sizeof(date),"%i,%i,%i",Day+7, Month, Year);
if(PlayerInfo[playerid][pJob] == Army)
{
if(PlayerInfo[playerid][SalaryDate] == date)
{
if(PlayerInfo[playerid][JobLevel]==1)
{
GivePlayerMoney(playerid,250000);
}
else
{
if(PlayerInfo[playerid][JobLevel]==2)
{
GivePlayerMoney(playerid,500000);
}
}
else
{
if(PlayerInfo[playerid][JobLevel]==3)
{
GivePlayerMoney(playerid,750000);
}
}
}
}
Error's are
Код:
D:\GTA San Andreas\Server\gamemodes\cdm.pwn(892) : error 035: argument type mismatch (argument 1)
D:\GTA San Andreas\Server\gamemodes\cdm.pwn(892) : error 035: argument type mismatch (argument 1)
D:\GTA San Andreas\Server\gamemodes\cdm.pwn(908) : error 029: invalid expression, assumed zero
Re: Having Some Problems :/ -
GoldenLion - 04.05.2017
"date" must be a string.
Re: Having Some Problems :/ -
andrejc999 - 04.05.2017
Yeah so just switch
new date;
with
new date[32];
Re: Having Some Problems :/ -
coool - 04.05.2017
Instead of
Код:
else
{
if(PlayerInfo[playerid][JobLevel]==2)
{
Use
Код:
else if(PlayerInfo[playerid][JobLevel]==2)
{
Re: Having Some Problems :/ -
Vince - 04.05.2017
I hope you realize that if "day" is greater than or equal to 25 you will end up with an invalid date.
Re: Having Some Problems :/ -
Hreesang - 05.05.2017
Quote:
Originally Posted by andrejc999
Yeah so just switch
new date;
with
new date[32];
|
Do like what he said and
PHP код:
if(PlayerInfo[playerid][SalaryDate] == date)
should be
PHP код:
if(!strcmp(PlayerInfo[playerid][SalaryDate], date, false))
Re: Having Some Problems :/ -
ShihabSoft - 05.05.2017
You should use strcmp for comparison between two strings.