if(strcmp(cmd, "/set", true) == 0)
{
new string[128];
if(sscanf(params, "udz", id, Option, Value))
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
SendClientMessage(playerid, -1, "SYNTAX: /set [Playerid] [Option] [Value]");
SendClientMessage(playerid, -1, "OPTIONS: Army, Origin, Interior, Skin, ArmyRank, Money, Age");
SendClientMessage(playerid, -1, "OPTIONS: Armor, Cirtual WorldPlayinghours, Score, Experience");
}
}
else
{
if(PlayerInfo[playerid][pAdmin] >=3)
{
if(strcmp(Option, "army", true) == 0) //this is Line 898
{
format(string, sizeof(string), "You have set %s's Army to %d.", GetName(id), Value);
SendClientMessage(playerid, -1, string);
SavePlayerDat(id);
PlayerInfo[id][pArmy] = Value;
PlayerInfo[id][pArmyRank] = 1;
}
}
}
}
if ( strcmp( Option, "army", false ) )
C:\Documents and Settings\nmader\Desktop\Folders\COVRP\gamemodes\COVRP.pwn(898) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
If(Option == army)
{
//your code
}
Instead if using strcmp you could use:-
pawn Код:
|
if(strcmp(cmd, "/set", true) == 0)
{
new string[128], opt[20];
if(PlayerInfo[playerid][pAdmin >= 3)
{
if(sscanf(params, "us[20]i", id, opt, Value))
{
if(strlen(opt) == 0)
{
SendClientMessage(playerid, -1, "SYNTAX: /set [Playerid] [Option] [Value]");
SendClientMessage(playerid, -1, "OPTIONS: Army, Origin, Interior, Skin, ArmyRank, Money, Age");
SendClientMessage(playerid, -1, "OPTIONS: Armor, Cirtual WorldPlayinghours, Score, Experience");
}
else
if(strcmp(opt, "army", true) == 0)
{
format(string, sizeof(string), "You have set %s's Army to %d.", GetName(id), Value);
SendClientMessage(playerid, -1, string);
SavePlayerDat(id);
PlayerInfo[id][pArmy] = Value;
PlayerInfo[id][pArmyRank] = 1;
}
}
}
return 1;
}
No. You cannot compare strings that way.
May I ask what the actual error is? (Assuming the one you posted above in another post isn't an attempt at rectifying the issue). |