2 errors. -
Odyssey - 10.08.2011
I am trying to make a callsign system for my flying server. Here is the code of which the errors are located in.
pawn Код:
if (dialogid == RegisterDialog)
{
new name[MAX_PLAYER_NAME], file[256], string[128], WelcomeMessage[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), UserFile, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return
ShowPlayerDialog(playerid, RegisterDialog, DIALOG_STYLE_INPUT, "Register", "Your account was not found on the database!\n Please make one to continue!", "Register", "Leave");
dini_Create(file);
dini_IntSet(file, "Password", udb_hash(inputtext));
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0);
dini_IntSet(file, "Money", 0);
dini_IntSet(file, "Score", 0);
dini_IntSet(file, "Callsign", name); //First Error
format(string, sizeof(string), "You have registered the name {FFFF00}%s{FFFFFF} under the password {FFFF00}%s{FFFFFF}.", name, inputtext);
SendClientMessage(playerid, COLOR_WHITE, string);
gPlayerLogged[playerid] = 1;
format(WelcomeMessage, sizeof(WelcomeMessage), "%s(%d) has joined the server for the first time!", name, playerid);
SendClientMessageToAll(COLOR_BLUE, WelcomeMessage);
ShowPlayerDialog(playerid, ClassDialog, DIALOG_STYLE_LIST, "Select a class", "Pilot\nAir Trafic Controll\nMedic\nSan Andreas Army", "Select", "");
}
pawn Код:
else if(dialogid == CallsignDialog)
{
if(!response) return HidePlayerDialog(playerid);
else {
new Message[128];
PlayerInfo[playerid][Callsign] = inputtext; //second error
format(Message, sizeof(Message), "You have changed your callsign to: {FFFF00}%s", inputtext);
SendClientMessage(playerid, COLOR_WHITE, Message);
}
}
Here are the errors:
Код:
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\gamemodes\VirtualPilots.pwn(178) : error 035: argument type mismatch (argument 3)
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\gamemodes\VirtualPilots.pwn(351) : error 006: must be assigned to an array
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Any help?
Re: 2 errors. -
CoaPsyFactor - 10.08.2011
format(PlayerInfo[playerid][Callsign], sizeof(inputtext), "%s", inputtext);
Re: 2 errors. -
CoaPsyFactor - 10.08.2011
and where have you defined 'name', where did you write new name[24]?
my bad i saw it now
Re: 2 errors. -
Odyssey - 10.08.2011
I just put
pawn Код:
new name[MAX_PLAYER_NAME];
With the
pawn Код:
format(PlayerInfo[playerid][Callsign], sizeof(inputtext), "%s", inputtext);
It gave me this:
Код:
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\gamemodes\VirtualPilots.pwn(351) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
Btw, stop using Hackintosh!
Re: 2 errors. -
Riddick94 - 10.08.2011
pawn Код:
format(inputtext, sizeof(inputtext), "%s", PlayerInfo[playerid][Callsign]);
Re: 2 errors. -
MadeMan - 10.08.2011
pawn Код:
dini_Set(file, "Callsign", name);
Show your PlayerInfo[playerid][Callsign] enum.
Re: 2 errors. -
Odyssey - 10.08.2011
pawn Код:
enum pInfo
{
AdminLevel,
VipLevel,
Cash,
Score,
Callsign,
Spawned,
Jailed,
Muted,
Frozen,
Class,
}
And I also get that warning with this:
format(inputtext, sizeof(inputtext), "%s", PlayerInfo[playerid][Callsign]);
Re: 2 errors. -
MadeMan - 10.08.2011
pawn Код:
enum pInfo
{
AdminLevel,
VipLevel,
Cash,
Score,
Callsign[64],
Spawned,
Jailed,
Muted,
Frozen,
Class,
}
pawn Код:
format(PlayerInfo[playerid][Callsign], 64, "%s", inputtext);
Re: 2 errors. -
Odyssey - 10.08.2011
Thanks! No errors!
+1 rep to MadeMan