18.02.2009, 23:33
Here are some of your problems
should be
dcmd_ functions are not commands but its a call to a dcmd_ function just think of it as calling stocks or publics
Try that and the repost the remaining errors
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(login,5,cmdtext);
dcmd(register,8,cmdtext);
dcmd(kill,4,cmdtext);
dcmd(stats,5,cmdtext);
dcmd_register(playerid,params[])
{
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");
if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'.");
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");
if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");
return true;
}
dcmd_login(playerid,params[])
{
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");
if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");
if (udb_CheckLogin(PlayerName(playerid),params))
{
GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));
PLAYERLIST_authed[playerid]=true;
return SystemMsg(playerid,"Successfully authed!");
}
return SystemMsg(playerid,"Login failed!");
}
dcmd_kill(playerid,params[])
{
SetPlayerHealth(playerid, 0);
SetPlayerArmour(playerid, 0);
return 1;
}
if(strcmp(cmdtext,"/dokai",true) == 0)
{
SetPlayerPos(playerid,-1547.3585,124.7388,3.5547);
return 1;
}
dcmd_login(playerid,params[])
{
new id, string[256], name[MAX_PLAYER_NAME];
if(!strlen(params)) id = playerid;
else id = strval(params);
if(IsPlayerConnected(id))
{
GetPlayerName(id,name,MAX_PLAYER_NAME);
SendClientMessage(playerid,COLOR_BROWN,"===================================");
format(string,sizeof(string),"%s :",name);
SendClientMessage(playerid,COLOR_GREEN,string);
SendClientMessage(playerid,COLOR_BROWN,"===================================");
format(string,sizeof(string),"Level: %d.",PlayerInfo[id][Level]);
SendClientMessage(playerid,COLOR_LIME,string);
format(string,sizeof(string),"EXP: %d.",PlayerInfo[id][EXP]);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,sizeof(string),"Kills: %d.",PlayerInfo[id][Kills]);
SendClientMessage(playerid,COLOR_GREEN,string);
format(string,sizeof(string),"Deaths: %d.",PlayerInfo[id][Deaths]);
SendClientMessage(playerid,COLOR_RED,string);
SendClientMessage(playerid,COLOR_BROWN,"===================================");
return 1;
}
}
return 0;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(login,5,cmdtext);
dcmd(register,8,cmdtext);
dcmd(kill,4,cmdtext);
dcmd(stats,5,cmdtext);
if(strcmp(cmdtext,"/dokai",true) == 0)
{
SetPlayerPos(playerid,-1547.3585,124.7388,3.5547);
return 1;
}
return 0;
}
dcmd_register(playerid,params[])
{
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");
if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'.");
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");
if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");
return true;
}
dcmd_login(playerid,params[])
{
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");
if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");
if (udb_CheckLogin(PlayerName(playerid),params))
{
GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));
PLAYERLIST_authed[playerid]=true;
return SystemMsg(playerid,"Successfully authed!");
}
return SystemMsg(playerid,"Login failed!");
}
dcmd_kill(playerid,params[])
{
SetPlayerHealth(playerid, 0);
SetPlayerArmour(playerid, 0);
return 1;
}
dcmd_login(playerid,params[])
{
new id, string[256], name[MAX_PLAYER_NAME];
if(!strlen(params)) id = playerid;
else id = strval(params);
if(IsPlayerConnected(id))
{
GetPlayerName(id,name,MAX_PLAYER_NAME);
SendClientMessage(playerid,COLOR_BROWN,"===================================");
format(string,sizeof(string),"%s :",name);
SendClientMessage(playerid,COLOR_GREEN,string);
SendClientMessage(playerid,COLOR_BROWN,"===================================");
format(string,sizeof(string),"Level: %d.",PlayerInfo[id][Level]);
SendClientMessage(playerid,COLOR_LIME,string);
format(string,sizeof(string),"EXP: %d.",PlayerInfo[id][EXP]);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,sizeof(string),"Kills: %d.",PlayerInfo[id][Kills]);
SendClientMessage(playerid,COLOR_GREEN,string);
format(string,sizeof(string),"Deaths: %d.",PlayerInfo[id][Deaths]);
SendClientMessage(playerid,COLOR_RED,string);
SendClientMessage(playerid,COLOR_BROWN,"===================================");
return 1;
}
}
Try that and the repost the remaining errors