please help
#1

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
Reply
#2

Put on top of script ?
Код:
new Banka;
Reply
#3

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;
}
Reply
#4

Remove giveplayerid = strval(params);

Replace if(sscanf(params,"ud",giveplayerid,sapd)) with if(sscanf(params,"dd",giveplayerid,amount))
Reply
#5

hahah :P That was a big fail :P Thankyou. i'm new to dcmd though .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)