28.07.2010, 08:10
(
Последний раз редактировалось iggy1; 28.07.2010 в 09:04.
)
You can't use OnPlayerCommandText with zcmd thats your problem. Use OnPlayerCommandRecieved, check out the zcmd topic for more info.
http://forum.sa-mp.com/showthread.ph...highlight=zcmd
Edit: Also are you using the sscanf 2.0 plugin? or just include?
2nd Edt: Try this, delete OnPlayerCommandText and replace it with this:
http://forum.sa-mp.com/showthread.ph...highlight=zcmd
Edit: Also are you using the sscanf 2.0 plugin? or just include?
2nd Edt: Try this, delete OnPlayerCommandText and replace it with this:
pawn Код:
CMD:register(playerid, params[])
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
if(IsLogged[playerid] == 0)
{
new password[25];//delete this if you have password declared
if(sscanf(params, "s", password)) return SendClientMessage(playerid, 0xFF0000AA, "SERVER USAGE: /register <Password>");
else
{
format(file, sizeof(file), "%s.ini", PlayerName);
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Password", udb_hash(password));
dini_IntSet(file, "Money", GetPlayerMoney(playerid));
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Skin", GetPlayerSkin(playerid));
dini_IntSet(file, "World", GetPlayerVirtualWorld(playerid));
dini_IntSet(file, "Interior", GetPlayerInterior(playerid));
SendClientMessage(playerid, 0xFF00FF00, "SERVER: You have succesfully registered the name, you can now /login");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "SERVER: That name is already registered, reconnect with another name if it isnt your account!");
}
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "SERVER: You are already logged in!");
}
return 1;
}

