04.06.2011, 19:59
Hey all. I have an error in my command:
Error line:
Please help
pawn Код:
COMMAND:setleader(playerid,params[])
{
new id,file[40],faction[40];
if(PlayerInfo[playerid][pAdminLevel] <2)return SendClientMessage(playerid,COLOR_RED,"You're not allowed to do this.");
if(sscanf(params,"us",id,faction)) return SendClientMessage(playerid,COLOR_GREY,"USAGE:/setleader [playerid] [faction]");
format(file,sizeof(file),"%s.ini",faction); // format file , file ? xD hmm xD , u need an important check here , u need to check if the person the admin is choosing is already in the same faction or not because if he is in another faction that would make a mess
if(fexist(file)) //its messed up Jup I see allow me to fix it? Sure :D
{
if(PlayerInfo[id][Faction] != strval(faction)) return SendClientMessage(playerid,COLOR_RED,"That Player Doesn't Belong To That Faction");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Is Not Connected");
else
{
new string[128];
new pName[24]; GetPlayerName(id,pName,24);
dini_Set(file,"Owner",pName);
format(string,sizeof(string),"Succesfully maded %s owner",pName);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,128,"Your Faction is : %s",PlayerInfo[id][Faction]);
SendClientMessage(id,COLOR_YELLOW,string);
PlayerInfo[playerid][Faction] = faction;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "This faction doesn't exists");
}
return 1;
}
pawn Код:
PlayerInfo[playerid][Faction] = faction;
Код:
C:\Users\Bart\Desktop\SampScripting\gamemodes\Sunlight.pwn(497) : error 035: argument type mismatch (argument 1) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.