sscanf Help PLEASE! -
Kodman262 - 13.02.2009
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"
Re: sscanf Help PLEASE! -
Daren_Jacobson - 13.02.2009
is sscanf in your script? it isn't a native function.
Re: sscanf Help PLEASE! -
Kodman262 - 13.02.2009
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;
}
Re: sscanf Help PLEASE! -
Mikep - 13.02.2009
Quote:
Originally Posted by Daren_Jacobson
it isn't a native function.
|
Re: sscanf Help PLEASE! -
SilentMouse - 13.02.2009
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(givecash, 8, cmdtext);
return 0;
}
I'm assuming your copied the wiki example?
Re: sscanf Help PLEASE! -
Kodman262 - 13.02.2009
Yes I did, and i have " dcmd(givecash, 8, cmdtext); " But it still comes up with that error. thats why im confused...
Re: sscanf Help PLEASE! -
SilentMouse - 13.02.2009
Код:
#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.
Re: sscanf Help PLEASE! -
pen_theGun - 13.02.2009
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
Re: sscanf Help PLEASE! -
Kodman262 - 13.02.2009
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?
Re: sscanf Help PLEASE! -
pen_theGun - 13.02.2009
=> Read Me <=