03.08.2016, 15:11
There are quite a few mistakes in this script.
Also, don't bother defining all those colors if you're not using them, all that's doing is hindering your compile time. You also shouldn't be using udb hashimg it's out dated and not secure, use whirlpool instead.
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/rules", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "1.Hello ! To Be Safe Read Our Rules Below!");
SendClientMessage(playerid, COLOR_YELLOW, "2.Do Not Hacking!");
SendClientMessage(playerid, COLOR_YELLOW, "3.Do Not Abusing!");
SendClientMessage(playerid, COLOR_YELLOW, "4.Respect Administrators & Owners!");
SendClientMessage(playerid, COLOR_YELLOW, "5.Admins Do Not Give Money To Players!");
SendClientMessage(playerid, COLOR_YELLOW, "6.Setting Level & Using Fake Commands To Fool The Owner It's not permitted, Else Permanent Ban From The Server");
SendClientMessage(playerid, COLOR_YELLOW, "7.Do Not Disturb Administrators & Owners While Afk.");
SendClientMessage(playerid, COLOR_YELLOW, "8.Do Not Set Yourself Ranks, Only The Owners Of Gang,Clan,Crew,Team Can discuss if you can get level 10 using for example: /setlf (your id) 10 If you are owner too You have to wait.");
SendClientMessage(playerid, COLOR_YELLOW, "9.Banning Players Without Reason, It Will Result In A Ban.");
SendClientMessage(playerid, COLOR_YELLOW, "10.While You're In Jail, Do Not Make Any Bad Thing, Because It will result in a kick.");
SendClientMessage(playerid, COLOR_YELLOW, "11.Do Not Spamming!");
SendClientMessage(playerid, COLOR_YELLOW, "12.Do Not Using Multi Accounts In The Server!");
SendClientMessage(playerid, COLOR_YELLOW, "13.Do Not Insulting Players!");
return 1;
}
if (strcmp("/register", cmdtext, true, 10) == 0)
{
if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_LIME, "ACCOUNT: You are now registered, and have been automaticaly logged in");
if (udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_LIME, "ACCOUNT: The name $d, is already registered on this server. Please login or you will be disconnected in 60 seconds.");
if (strlen(params) == 0) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Usage: '/register [password]");
if (strlen(params) < 4 || strlen(params) > 20) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Password length must be greater than three characters");
if (udb_Create(PlayerName2(playerid),params))
//rest of your command
return 1; //returning TRUE
}
return 0;
}