Need help with 4 errors
#1

I Get these errors:
Код:
C:\Users\Jampie\Desktop\pcash test\gamemodes\grandlarc.pwn(53) : error 029: invalid expression, assumed zero
C:\Users\Jampie\Desktop\pcash test\gamemodes\grandlarc.pwn(53) : warning 215: expression has no effect
C:\Users\Jampie\Desktop\pcash test\gamemodes\grandlarc.pwn(53) : error 001: expected token: ";", but found ")"
C:\Users\Jampie\Desktop\pcash test\gamemodes\grandlarc.pwn(53) : error 029: invalid expression, assumed zero
C:\Users\Jampie\Desktop\pcash test\gamemodes\grandlarc.pwn(53) : fatal error 107: too many error messages on one line
with this command:
Код:
new cmd[256], idx;
	cmd = strtok(cmdtext, idx);

	if(strcmp("/GiveJCash", cmd, true) == 0)
	{
		new tmp[256];
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, red, "You did not give an ID or ammount");
		if(strval(tmp) == playerid) return SendClientMessage(playerid, red, "You can not give yourself PCash");
		if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, red, "That player is not connected");

		new tmp2[256];
		tmp2 = strtok(cmdtext, idx);
		if(!strlen(tmp2)) return SendClientMessage(playerid, red, "You did not give an ammount");

		new player = strval(tmp);
		new ammount = strval(tmp2);

		if(GetPlayerPCash(playerid) < ammount) return SendClientMessage(playerid, red, "You do not have enough PCash");

		new pname[MAX_PLAYER_NAME];
		GetPlayerName(player, pname, sizeof(pname));

		new oname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, oname, sizeof(oname));

		new string[256];
		format(string, sizeof(string), "You have given %s %d PCash", pname, ammount);
		SendClientMessage(playerid, green, string);

		format(string, sizeof(string), "You have been given %d PCash by %s", ammount, oname);
		SendClientMessage(player, green, string);

		GivePlayerPCash(player, ammount);
		GivePlayerPCash(playerid, -ammount);
		return 1;
	}
Reply
#2

what is line 53..
Reply
#3

Quote:
Originally Posted by sjvt
Посмотреть сообщение
what is line 53..
here ;p
Код:
if(!strlen(tmp)) return SendClientMessage(playerid, red, "You did not give an ID or ammount");
Reply
#4

There is nothing wrong with it, btw why you use 256.. 128 is enough for it
Reply
#5

Quote:
Originally Posted by sjvt
Посмотреть сообщение
There is nothing wrong with it, btw why you use 256..
that is line 53 but is there nothing wrong with the cmd??

EDIT: Even when i remove the command i get the 4 errors lol
but its line 53..
Reply
#6

Did build it in a new.pwn and did change a few functions because i don't use 'GetPlayerPCash, and it compiled correct. So with that command there is nothing wrong
Reply
#7

I think the error has nothing to do with that command, please paste the definition of "red"
Reply
#8

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
I think the error has nothing to do with that command, please paste the definition of "red"
thats right i did in top of the script #define Red and #define green i replaced them with #define red 0xFF0000AA
and #define green 0x33FF33AA now i only got 1 error:

Код:
C:\Users\Jampie\Desktop\pcash test\gamemodes\grandlarc.pwn(125) : error 021: symbol already defined: "strtok"
srry if its simple error im new ;p
Reply
#9

Search your scripts first 25 lines and remove the line which has Strtok in it
Reply
#10

Quote:
Originally Posted by thekiller01
Посмотреть сообщение
thats right i did in top of the script #define Red and #define green i replaced them with #define red 0xFF0000AA
and #define green 0x33FF33AA
OMG, I don't know how did I guess it, I should be a kind of Sherlock Holmes :P

Quote:
Originally Posted by thekiller01
Посмотреть сообщение
now i only got 1 error:

Код:
C:\Users\Jampie\Desktop\pcash test\gamemodes\grandlarc.pwn(125) : error 021: symbol already defined: "strtok"
srry if its simple error im new ;p
Means that strtok is already made in one of your include file, so you don't need it anymore in the gamemode, Press CTRL+F and search "stock strtok"(or just "strtok" if not working), and where you find the function delete it (Header and body)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)