06.11.2009, 18:16
Hello there, I got a problem with the commands /factionname and /factionrank, I will post the first few lines, cause rest is the same.
Errors are posted in the pawn code.
Errors are posted in the pawn code.
pawn Код:
if(strcmp(cmd, "/factionname", true) == 0) // Dstoft
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 4) { SendClientMessage(playerid, COLOR_RED, " Acces Denied!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Command: /factionname [number] [newname]");
return 1;
}
new File: hFile;
hFile = fopen("faction.ini", io_write);
new faction = strval(tmp);
if(faction == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "Command: /factionname [number] [newname]");
return 1;
}
new FactionName; // \VW-RP.pwn(12555) : warning 203: symbol is never used: "FactionName"
format(FactionName,sizeof(FactionName), "Faction Name = %s", result); // This error x2 \VW-RP.pwn(12556) : error 035: argument type mismatch (argument 1)
fwrite(hFile, FactionName); // \VW-RP.pwn(12557) : error 035: argument type mismatch (argument 2)
fclose(hFile);
return 1;