30.05.2009, 12:51
Invalid funtion or declaration. Means that the function doesn't exist, or bad syntax.
pawn Код:
new string[256]; //<--- You're not using a string yet. That's why you get the warning: "Symbol is assigned a value that is never used: "string""
new moneys; //Changed to moneyz
new giveplayerid;
new sendername[MAX_PLAYER_NAME]; //<--- Not used yet gives a warning.
new giveplayer[MAX_PLAYER_NAME]; //<--- Not used yet gives a warning.
new cmd[256];
new idx; //<-- You need this
cmd = strtok(cmdtext, idx); //this is changed from. cmd = strtok(cmdtext);
//shouldn't there be a start of a command here? Maybe /help
if(strcmp(cmd, "/help", true) == 0) //like this
{
SendClientMessage(playerid, COLOR_GREEN," Помощь по моду");
SendClientMessage(playerid, COLOR_YELLOW," Это свободный режим игры, целью которого является убийство игроков и заработок денег. ");
SendClientMessage(playerid, COLOR_YELLOW,"Стойте на специальных пунктах чтобы получить деньги. ");
SendClientMessage(playerid, COLOR_YELLOW,"Для более быстрого заработка можно купить бизнес");
SendClientMessage(playerid, COLOR_YELLOW,"Ложите свои деньги в банк. Они находятся в магазинах.");
SendClientMessage(playerid, COLOR_YELLOW,"Враг сильнее тебя? Закажи его командой /hitman");
SendClientMessage(playerid, COLOR_YELLOW,"Используй /givecash чтобы поделится денигами");
SendClientMessage(playerid, COLOR_YELLOW,"Купленное оружие будет выдоваться вам на смавне.");
SendClientMessage(playerid, COLOR_RED,"Набери /commands чтобы узнать больше, и /gangcommands Чтобы узнать команды банд.");
return 1;
} //Here's your other problem. You where already closing OnPlayerCommandText here!
if(strcmp(cmd, "/givecash", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp); //asaign the tmp to giveplayerid
if(!strval(tmp)) //strval becuase it's a number
{
SendClientMessage(playerid, COLOR_WHITE, "Использование: /givecash [playerid] [amount]");
return 1;
}
new tmp2[256]; //new tmp2 becuase tmp is already under use
tmp2 = strtok(cmdtext, idx);
if(!strval(tmp2)) //strval
{
SendClientMessage(playerid, COLOR_WHITE, "Использование: /givecash [playerid] [amount]");
return 1;
}
moneys = strval(tmp2); //moneys = tmp2
GivePlayerMoney(giveplayerid, moneys); //GivePlayerMoney(playerid = giveplayerid, amount = moneys);
return 1;
} //closing /givecash
return 0; //If the typed command doesn't exists. Return unknown command.
} //closing OnPlayerCommandText