please help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: please help (
/showthread.php?tid=160498)
please help -
bartje01 - 16.07.2010
I have this command:
pawn Код:
dcmd_setbank(playerid,params[])
{
new giveplayerid;
giveplayerid = strval(params);
new amount;
if(adminlevel[playerid] <=4)
{
SendClientMessage(playerid,COLOR_RED,"You are not allowed to do this");
return 1;
}
if(sscanf(params,"ud",giveplayerid,banka))
{
SendClientMessage(playerid,COLOR_RED,"USAGE:/setbank [playerid] [amount]");
return 1;
}
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid,COLOR_RED,"This player is not connected");
return 1;
}
banka[giveplayerid] = amount; //this line :O
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"Your bank money is setted to %d by %s",amount,playername);
SendClientMessage(giveplayerid,COLOR_RED,string);
GetPlayerName(giveplayerid,playername,sizeof(playername));
format(string,sizeof(string),"You have setted %s his bankmoney to %d",playername,amount);
SendClientMessage(playerid,COLOR_RED,string);
}
got this errors:
*D:\joram server\gamemodes\Dutchlife.pwn(4994) : error 017: undefined symbol "banka"
D:\joram server\gamemodes\Dutchlife.pwn(4994) : warning 215: expression has no effect
D:\joram server\gamemodes\Dutchlife.pwn(4994) : error 001: expected token: ";", but found "]"
D:\joram server\gamemodes\Dutchlife.pwn(4994) : error 029: invalid expression, assumed zero
D:\joram server\gamemodes\Dutchlife.pwn(4994) : fatal error 107: too many error messages on one line
thanks
Re: please help -
Hamza' - 16.07.2010
Put on top of script ?
Re: please help -
bartje01 - 16.07.2010
ok fixed. But what is wrong with this

It always says that it's setted to 0
pawn Код:
dcmd_setsapd(playerid,params[])
{
new string[286];
new giveplayerid;
giveplayerid = strval(params);
new amount;
if(adminlevel[playerid] <=4)
{
SendClientMessage(playerid,COLOR_RED,"You are not allowed to do this");
return 1;
}
if(sscanf(params,"ud",giveplayerid,sapd))
{
SendClientMessage(playerid,COLOR_RED,"USAGE:/setbank [playerid] [amount]");
return 1;
}
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid,COLOR_RED,"This player is not connected");
return 1;
}
sapd[giveplayerid] = amount;
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"Your sapd is setted to %d by %s",amount,playername);
SendClientMessage(giveplayerid,COLOR_RED,string);
GetPlayerName(giveplayerid,playername,sizeof(playername));
format(string,sizeof(string),"You have setted %s his sapd to %d",playername,amount);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
Re: please help -
Betamaster - 17.07.2010
Remove giveplayerid = strval(params);
Replace if(sscanf(params,"ud",giveplayerid,sapd)) with if(sscanf(params,"dd",giveplayerid,amount))
Re: please help -
bartje01 - 17.07.2010
hahah :P That was a big fail :P Thankyou. i'm new to dcmd though .