01.07.2013, 09:50
How do i create a stats command ?
i ready have a player info
please give me a code of command stats and changepass.
i ready have a player info
please give me a code of command stats and changepass.
enum pInfo { pPass, pCash, pScore, pAdmin, }
CMD:stats(playerid,params[])
{
new name[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s's stats",name);
SendClientMessage(playerid,0xFF8000AA,string);
format(string,sizeof(string),"Cash: $%d",pInfo[playerid][pCash]);
SendClientMessage(playerid,0xFF4000AA,string);
format(string,sizeof(string),"Score: %d",pInfo[playeid][pScore]);
SendClientMessage(playerid,0xFF1000FF,string);
format(string,sizeof(string),"Password: %s",pInfo[playerid][pPass]);
SendClientMessage(playerid,0xAAAAAAFF,string);
return 1;
}
CMD:changepass(playerid,params[])
{
new pass;
if(sscanf(params,"s",pass)) return SendClientMessage(playerid,0xCCCCCCAA,"/changepass [new password]");
if(pass > 24 || pass < 0) return SendClientMessage(playerid,0xCCCCCCAA,"Invalid character length.");
pInfo[playerid][pPass] = pass;
format(string,sizeof(string),"You've changed your password to %s",pass);
SendClientMessage(playerid,0xFF4000AA,string);
return 1;
}
CMD:changepass(playerid,params[])
{
new pass,name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(sscanf(params,"s",pass)) return SendClientMessage(playerid,0xCCCCCCAA,"/changepass [new password]");
if(pass > 24 || pass < 0) return SendClientMessage(playerid,0xCCCCCCAA,"Invalid character length.");
pInfo[playerid][pPass] = pass;
format(string,sizeof(string),"You've changed your password to %s",pass);
SendClientMessage(playerid,0xFF4000AA,string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pInfo[i][pAdmin] > 1)
{
format(string,sizeof(string),"%s changed his password to %s",name,pass);
SendClientMessage(i,0xFFFFFFAA,string);
}
}
return 1;
}
C:\Documents and Settings\hung\Desktop\NewServerss\gamemodes\DM.pwn(2467) : error 017: undefined symbol "string" C:\Documents and Settings\hung\Desktop\NewServerss\gamemodes\DM.pwn(2467) : error 017: undefined symbol "string" C:\Documents and Settings\hung\Desktop\NewServerss\gamemodes\DM.pwn(2467) : error 029: invalid expression, assumed zero C:\Documents and Settings\hung\Desktop\NewServerss\gamemodes\DM.pwn(2467) : fatal error 107: too many error messages on one line
new string[128];
CMD:changepass(playerid,params[])
{
new pass,string[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(sscanf(params,"s",pass)) return SendClientMessage(playerid,0xCCCCCCAA,"/changepass [new password]");
if(pass > 24 || pass < 0) return SendClientMessage(playerid,0xCCCCCCAA,"Invalid character length.");
pInfo[playerid][pPass] = pass;
format(string,sizeof(string),"You've changed your password to %s",pass);
SendClientMessage(playerid,0xFF4000AA,string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pInfo[i][pAdmin] > 1)
{
format(string,sizeof(string),"%s changed his password to %s",name,pass);
SendClientMessage(i,0xFFFFFFAA,string);
}
}
return 1;
}