09.07.2011, 00:05
Go to the bottom for the code, i carnt get /register worked. Help please? =)
[ame]http://www.youtube.com/watch?v=RHbn2ZMe3CY[/ame]
--------------------------------------------------------
The Codeing.
---------------------------------------------------------
if(strcmp(question, "register", true) == 0 ||strcmp(question, "/register", true) == 0){
correct=1;
SendClientMessage(playerid, COLOR_MENU,"______________________________________ _____________________________________");
SendClientMessage(playerid, COLOR_MENU,"* With this command you can register yourself (your nickname) on this");
SendClientMessage(playerid, COLOR_MENU,"* server, so that all your personal data (money, owned properties, weapons)");
SendClientMessage(playerid, COLOR_MENU,"* are stored. You need also register yourself in order to login and");
SendClientMessage(playerid, COLOR_MENU,"* interact fully with the other players.");
SendClientMessage(playerid, COLOR_MENU,"* Usage: /register [yourpassword]");
SendClientMessage(playerid, COLOR_MENU,"______________________________________ _____________________________________");
}
----------------------------------------------------------------------------------------------------------------Next code
---------------------------------------------------------------------------------------------------------------
dcmd_stopcd(playerid,params[]) {
#pragma unused params
return dcmd_stopcountdown(playerid,params);
}
dcmd_register(playerid,params[]) {
new index = 0;
tmps1 = strtok(params, index);
GetPlayerName(playerid, playername, sizeof(playername));
if(!strlen(tmps1)) {
SendClientMessage(playerid, COLOR_CMD, "* USAGE: /register [password]. This will register your nick. Don't forget your password.");
return 1;
}
if(20 < strlen(tmps1) || strlen(tmps1) < 5) {
SendClientMessage(playerid, COLOR_SYSTEM_PW, "* Password length must be 5-20 symbols.");
return 1;
} else {
if (!dini_Exists(udb_encode(playername))) {
dini_Create(udb_encode(playername));
dini_IntSet(udb_encode(playername), "password", udb_hash(tmps1));
dini_IntSet(udb_encode(playername), "newplayer", 1);
format(strings, sizeof(strings), "%s --- %s (id: %d) created account. Passwordhash: %s.", SystemTime,playername, playerid,udb_hash(tmps1));
printf(strings);
format(strings, sizeof(strings), "* Account named %s created! You can login with password %s.", playername, tmps1);
SendClientMessage(playerid, COLOR_SYSTEM_PM, strings);
if(spawned[playerid]){
GameTextForPlayer(playerid, "~w~ You are not logged in! type /login", 120000, 3);
LoginTimeout[playerid]=60;
}
} else {
format(strings, sizeof(strings), "* %s is already registered.", playername,tmps1);
SendClientMessage(playerid, COLOR_SYSTEM_PW, strings);
}
}
return 1;
}
AnyOne know how to fix this? i would really apreciate it
[ame]http://www.youtube.com/watch?v=RHbn2ZMe3CY[/ame]
--------------------------------------------------------
The Codeing.
---------------------------------------------------------
if(strcmp(question, "register", true) == 0 ||strcmp(question, "/register", true) == 0){
correct=1;
SendClientMessage(playerid, COLOR_MENU,"______________________________________ _____________________________________");
SendClientMessage(playerid, COLOR_MENU,"* With this command you can register yourself (your nickname) on this");
SendClientMessage(playerid, COLOR_MENU,"* server, so that all your personal data (money, owned properties, weapons)");
SendClientMessage(playerid, COLOR_MENU,"* are stored. You need also register yourself in order to login and");
SendClientMessage(playerid, COLOR_MENU,"* interact fully with the other players.");
SendClientMessage(playerid, COLOR_MENU,"* Usage: /register [yourpassword]");
SendClientMessage(playerid, COLOR_MENU,"______________________________________ _____________________________________");
}
----------------------------------------------------------------------------------------------------------------Next code
---------------------------------------------------------------------------------------------------------------
dcmd_stopcd(playerid,params[]) {
#pragma unused params
return dcmd_stopcountdown(playerid,params);
}
dcmd_register(playerid,params[]) {
new index = 0;
tmps1 = strtok(params, index);
GetPlayerName(playerid, playername, sizeof(playername));
if(!strlen(tmps1)) {
SendClientMessage(playerid, COLOR_CMD, "* USAGE: /register [password]. This will register your nick. Don't forget your password.");
return 1;
}
if(20 < strlen(tmps1) || strlen(tmps1) < 5) {
SendClientMessage(playerid, COLOR_SYSTEM_PW, "* Password length must be 5-20 symbols.");
return 1;
} else {
if (!dini_Exists(udb_encode(playername))) {
dini_Create(udb_encode(playername));
dini_IntSet(udb_encode(playername), "password", udb_hash(tmps1));
dini_IntSet(udb_encode(playername), "newplayer", 1);
format(strings, sizeof(strings), "%s --- %s (id: %d) created account. Passwordhash: %s.", SystemTime,playername, playerid,udb_hash(tmps1));
printf(strings);
format(strings, sizeof(strings), "* Account named %s created! You can login with password %s.", playername, tmps1);
SendClientMessage(playerid, COLOR_SYSTEM_PM, strings);
if(spawned[playerid]){
GameTextForPlayer(playerid, "~w~ You are not logged in! type /login", 120000, 3);
LoginTimeout[playerid]=60;
}
} else {
format(strings, sizeof(strings), "* %s is already registered.", playername,tmps1);
SendClientMessage(playerid, COLOR_SYSTEM_PW, strings);
}
}
return 1;
}
AnyOne know how to fix this? i would really apreciate it