What i have wrong here
#1

HTML Code:
	if (strcmp("/Money", cmdtext, true, 10) == 0)
	{
		GivePlayerMoney(playerid, money);
		return 1;
	}
	return 0;
Error
HTML Code:
C:\Users\Gigi\Desktop\America Life\gamemodes\tutorial.pwn(103) : error 017: undefined symbol "money"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Line 103 >>>>GivePlayerMoney(playerid, money);
Reply
#2

Quote:
Originally Posted by Dezzzy
View Post
Error
HTML Code:
C:\Users\Gigi\Desktop\America Life\gamemodes\tutorial.pwn(103) : error 017: undefined symbol "money"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Line 103 >>>>GivePlayerMoney(playerid, money);
money isn't defined and you are using it.

The example you post assumes that money will be set.

You could put
HTML Code:
new money = 10000;
at the top of the script and that'd make, money, work.
Reply
#3

Instead of 'money', write the amount of money you want. For example '100000', Ofcourse without quote
Reply
#4

David it works but i want like , when i type money id and amount .. not only 10000
Reply
#5

Read this:
https://sampforum.blast.hk/showthread.php?tid=473769
Reply
#6

Then using sscanf would help

pawn Code:
if (strcmp("/Money", cmdtext, true,6) == 0)
{
    new id,amount;
    if(sscanf(cmdtext[7],"ui",id,amount)) return SendClientMessage(playerid,-1,"USAGE:/Money [id] [amount]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Invalid player");
    GivePlayerMoney(id,amount);
}
Reply
#7

Have you even read what he said? he wanted money not skin.
Reply
#8

Start using zcmd and sscanf and do it like this:

pawn Code:
CMD:money(playerid, params[])
{
    new id, money;
    if(sscanf(params, "ui", id, money))
        return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /money [id] [amount]");
    GivePlayerMoney(id, money);
    return 1;
}
Reply
#9

Maybe he can read the tutorial and learn how to create a command using ZCMD and sscanf and use that knowledge to create any command, no matter changing player's skin or setting their money.
Reply
#10

Quote:
Originally Posted by SKAzini
View Post
Start using zcmd and sscanf and do it like this:

pawn Code:
CMD:money(playerid, params[])
{
    new id, money;
    if(sscanf(params, "ui", id, money))
        return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /money [id] [amount]");
    GivePlayerMoney(id, money);
    return 1;
}
i did and got this error
HTML Code:
C:\Users\Gigi\Desktop\America Life\gamemodes\tutorial.pwn(103) : error 017: undefined symbol "sscanf"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)