15.07.2011, 00:16
I'm making RPG GM and i working on /changename command i use djson for write/load data and ycmd for command processor
My command shoud be like /changename [playerid] [new name]
but if that 'new name' already exist it will not change name for 'playerid'
this is my command:
Can someone help me about that part of job?
My command shoud be like /changename [playerid] [new name]
but if that 'new name' already exist it will not change name for 'playerid'
this is my command:
pawn Код:
YCMD:changename(playerid,params[],help)
{
#pragma unused help
new
id,
name[MAX_PLAYER_NAME],
string[2][128],
iData[64];
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid,""#hex_siva"Moras biti administrator kako bi mogao koristiti ovu komandu!",""#hex_siva"Just administrators can use that command.");
else if(sscanf(params,"us[MAX_PLAYER_NAME]",id,name)) return SCM(playerid, ""#hex_siva"KORISTI: /changename [ID] [Novo Ime]", ""#hex_siva"USAGE: /changename [ID] [New Name]");
else if(id == INVALID_PLAYER_ID) return SCM(playerid,""#hex_siva"SERVER: Igrac nije online.",""#hex_siva"SERVER: Player with that ID is offline.");
else
{
format(iData, sizeof iData, SERVER_DATA, GetName(id));
if(strcmp(iData, name, true)
{
}
}
return true;
}