28.12.2012, 16:40
Hello,alot of you will say to me i should switch systems but for now i'm just gonna have to live with it ;p,
Anyways anyone know how to convert these two commands or can convert it to STRCMP?
and
Anyone know how to convert these to STRCMP? ![Sad](images/smilies/sad.gif)
REP will be given.
Regards
Oscii
Anyways anyone know how to convert these two commands or can convert it to STRCMP?
pawn Код:
dcmd_register(playerid,params[]) {
new PLAYERIP[18];
//GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SendClientMessage(playerid,COLOR_BRIGHTRED,"(INFO) You have already logged into your server account.");
// The command shouldn't work if an account with this
// nick already exists
if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid,COLOR_BRIGHTRED,"(INFO) You cannot register an account, as this name is alredy registered. Please login.");
// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"USAGE: /Register [And a password].");
// We save the money to the accstate
if (udb_Create(PlayerName(playerid),params)) {
//new PLAYERIP[16];
new D, M, Y;
new Month[64];
new DATE[64];
new IPANDDATE[128];
new h,m,s;
dUserSet(PlayerName(playerid)).("X","-206.5340"); // SF - METRO HOTEL
dUserSet(PlayerName(playerid)).("Y","1116.5568"); // SF - METRO HOTEL
dUserSet(PlayerName(playerid)).("Z","19.7422"); // SF - METRO HOTEL
dUserSet(PlayerName(playerid)).("Interior","0");
dUserSet(PlayerName(playerid)).("WorldID","0");
dUserSet(PlayerName(playerid)).("Money","2000");
dUserSet(PlayerName(playerid)).("bank","5000");
if(strlen(dini_Get("/GPMSS/DLicenses.txt",PlayerName(playerid)))==0){ dini_Set("/GPMFC/DLicenses.txt", PlayerName(playerid),"PROBATIONARY"); }else{ }
if(strlen(dini_Get("/GPMSS/DLicensePoints.txt",PlayerName(playerid)))==0){ dini_Set("/GPMFC/DLicensePoints.txt", PlayerName(playerid),"1"); }else{ }
dini_Set("/GPMFC/DLicenseCard.txt", PlayerName(playerid),"1");//*
// if(strlen(dini_Get("/GPMSS/Bank.txt",PlayerName(playerid)))==0){ dini_Set("/GPMFC/Bank.txt", PlayerName(playerid),"5000");
// else
// SetPlayerMoney(playerid,2000);
getdate(Y, M, D);
gettime(h,m,s);
GetPlayerIp(playerid, PLAYERIP, sizeof(PLAYERIP));
format(Month, 64, "%s", MonthNames2[M-1]);
//format(DATE, sizeof(DATE), "%s/%d/%d", Month,D,Y);
format(DATE, sizeof(DATE), "(%s/%d/%d)(%d:%d:%d)(%s)", Month,D,Y, h,m,s,TIME_ZONE);
format(IPANDDATE, sizeof(IPANDDATE), "%s - %s", DATE, PLAYERIP);
dini_Set("/GPMSS/IP-REG.txt", PlayerName(playerid),IPANDDATE);
dUserSet(PlayerName(playerid)).("Date",DATE);
dUserSet(PlayerName(playerid)).("IP",PLAYERIP);
// LICENSE EXPIRY DATE -------------
new ExpMonth[64];
new ExpDAY;
new ExpMONTH;
new ExpYEAR;
new ExpDATE[64];
getdate(Y, M, D);
// CALCULATE DATE + 7 DAYS
if(D>=18){
ExpDAY = (D+14)-31;
if(M==11){
ExpMONTH = 0;
ExpYEAR = Y+1;
}else{
ExpMONTH = M+1;
ExpYEAR = Y;
}
}else{
ExpDAY = (D+14);
ExpMONTH = M;
ExpYEAR = Y;
}
// SET EXPIRY DATE
format(ExpMonth, 64, "%s", MonthNames[ExpMONTH-1]);
format(ExpDATE, sizeof(ExpDATE), "%s %d, %d", ExpMonth,ExpDAY,ExpYEAR);
if(strlen(dini_Get("/GPMSS/DLicenseExp.txt",PlayerName(playerid)))==0){ dini_Set("/GPMFC/DLicenseExp.txt",PlayerName(playerid),ExpDATE); }else{ }
new IPTEXT[16];
format(IPTEXT, sizeof(IPTEXT), "%s", PLAYERIP);
format(erpstring, sizeof(erpstring), "(SSINFO) (REGIS) %s (ID:%d) - (IP:%s).", PlayerName(playerid), playerid, IPTEXT);
SendMessageToStaff_L4R(erpstring);
// END ----------------------------
SystemMsg(playerid,"An GPM server account has been created in your respect. You may and must now login.");
SendClientMessage(playerid,COLOR_YELLOW,"(INFO) An GPM server account has been created in your respect. You may and must now login.");
SendClientMessage(playerid,COLOR_GREY,"$5000 have been transfered to your Bank of America account. You may access it from any bank.");
GameTextForPlayer(playerid,"~r~~h~NOTE ~n~~r~You must apply for a license to be able to drive any vehicle.",6000,3);
}
return true;
}
pawn Код:
dcmd_login(playerid,params[]) {
new tmp4[256];
new playername[MAX_PLAYER_NAME];
// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"You are already logged in.");
// The command shouldn't work if an account with this
// nick does not exists
if (!udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid,COLOR_BRIGHTRED,"(INFO) An account with your name has not yet been created on the server."); SendClientMessage(playerid,COLOR_GREY,"Please use /Register [And a password] in order to register an account.");
// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"USAGE: /Login [Your password].");
// if (udb_CheckLogin(PlayerName(playerid),params)) {
// Login was correct
// Following thing is the same like the missing SetPlayerCommand
// GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("Money")-GetPlayerMoney(playerid));
// NOT USED
SetPlayerPos(playerid,
float(dUserINT(PlayerName(playerid)).("X")),
float(dUserINT(PlayerName(playerid)).("Y")),
float(dUserINT(PlayerName(playerid)).("Z")));
SetPlayerInterior(playerid,dUserINT(PlayerName(playerid)).("Interior")-GetPlayerInterior(playerid));
SetPlayerVirtualWorld(playerid,dUserINT(PlayerName(playerid)).("WorldID")-GetPlayerVirtualWorld(playerid));
// NOT USED
tmp4 = dini_Get(udb_encode(playername), "bank");
TogglePlayerControllable(playerid,1);
SetPlayerColor(playerid,COLOR_GREY);
LoggedIn[playerid] = 1;
SetCameraBehindPlayer(playerid);
FirstSpawn[playerid]=1;
SpawnPlayer(playerid);
PLAYERLIST_authed[playerid]=true;
new PLAYERIP[16];
GetPlayerIp(playerid, PLAYERIP, sizeof(PLAYERIP));
new IPTEXT[16];
format(IPTEXT, sizeof(IPTEXT), "%s", PLAYERIP);
format(erpstring, sizeof(erpstring), "(SSINFO) (LOGIN) %s (ID:%d) - (IP:%s).", PlayerName(playerid), playerid, IPTEXT);
SendMessageToStaff_L4R(erpstring);
return SendClientMessage(playerid,COLOR_YELLOW,"(INFO) You are now logged in.");
}
/*else
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"(INFO) The password you have submitted is incorrect.");
SendClientMessage(playerid,COLOR_GREY,"Please use /Login [And your password] in order to try again.");
}
return true;
}*/
![Sad](images/smilies/sad.gif)
REP will be given.
Regards
Oscii