sscanf Help PLEASE!
#1

Can you please help me im at a total lost! thank you!

Код:
dcmd_givecash(playerid, params[])
{
	new giveplayerid;
	new amount;
	
	if (sscanf(params, "dd", giveplayerid, amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /givecash [playerid/partname] [amount]"); <--- 1288 here!
	else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
	else if (amount > GetPlayerMoney(playerid)) SendClientMessage(playerid, 0xFF0000AA, "Insufficient Funds");
	else
	{
		GivePlayerMoney(giveplayerid, amount);
		GivePlayerMoney(playerid, 0 - amount);
		SendClientMessage(playerid, 0x00FF00AA, "Money sent");
		SendClientMessage(giveplayerid, 0x00FF00AA, "Money recieved");
	}
	return 1;
}
Error :
Код:
C:\Documents and Settings\Kody\Desktop\SAMP\gamemodes\CT.pwn(1288) : error 017: undefined symbol "sscanf"
Reply
#2

is sscanf in your script? it isn't a native function.
Reply
#3

dcmd_givecash(playerid, params[])
{
new giveplayerid;
new amount;

if (sscanf(params, "dd", giveplayerid, amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /givecash [playerid/partname] [amount]"); <--- 1288 here!
else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
else if (amount > GetPlayerMoney(playerid)) SendClientMessage(playerid, 0xFF0000AA, "Insufficient Funds");
else
{
GivePlayerMoney(giveplayerid, amount);
GivePlayerMoney(playerid, 0 - amount);
SendClientMessage(playerid, 0x00FF00AA, "Money sent");
SendClientMessage(giveplayerid, 0x00FF00AA, "Money recieved");
}
return 1;
}
Reply
#4

Quote:
Originally Posted by Daren_Jacobson
it isn't a native function.
Reply
#5

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(givecash, 8, cmdtext);
	return 0;
}
I'm assuming your copied the wiki example?
Reply
#6

Yes I did, and i have " dcmd(givecash, 8, cmdtext); " But it still comes up with that error. thats why im confused...
Reply
#7

Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
That too? Sorry if these seem like lame questions.
Reply
#8

Quote:

C:\Documents and Settings\Kody\Desktop\SAMP\gamemodes\CT.pwn(128 : error 017: undefined symbol "sscanf"

Quote:
Originally Posted by Daren_Jacobson
is sscanf in your script? it isn't a native function.
^^ You do not have sscanf function at all !
sscanf
Reply
#9

Quote:
Originally Posted by pen_†ĥęGun
Quote:

C:\Documents and Settings\Kody\Desktop\SAMP\gamemodes\CT.pwn(128 : error 017: undefined symbol "sscanf"

Quote:
Originally Posted by Daren_Jacobson
is sscanf in your script? it isn't a native function.
^^ You do not have sscanf function at all !
sscanf
Than how do i add one?
Reply
#10

=> Read Me <=
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)