05.02.2009, 21:18
I need help with a scirpt, It's none of the gamemodes on this site, I can't get my register and logon system to work, I won't post the scirpt on the forums.
Originally Posted by Static_X
then.. if you dont post it and no error's what accour.. how people can help you then ?!
|
Originally Posted by ssǝן‾ʎ
We're willing to help you but you need to show us the script for us to do so!
|
Originally Posted by Mikep
Whos gonna download it..?
|
Originally Posted by Mikep
I gussed you would just be posting the register and login shiz..
|
if(strcmp(cmd, "/regnick", true) == 0 || strcmp(cmd, "/register", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /register [password]"); return 1; } new passlength = strlen(tmp); if(passlength > 10) { SendClientMessage(playerid, COLOR_RED, "Sorry, passwords must be smaller than 10 letters"); return 1; } if (gPlayerAccount[playerid] == 1) { SendClientMessage(playerid, COLOR_GRAD1, " That name is registered"); return 1; } gPlayerAccount[playerid] = 1; strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255); Encript(PlayerInfo[playerid][pPassword]); GetPlayerName(playerid, playername, sizeof(playername)); format(string, sizeof(string), "%s.cer", playername); PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]; new File: file = fopen(string, io_read); if (file) { SendClientMessage(playerid, COLOR_GRAD1, " That nick is registered"); fclose(file); return 1; } printf("%s has created an account.", playername); new File:hFile; hFile = fopen(string, io_append); new var[32];// format(var, 32, "%sn", PlayerInfo[playerid][pPassword]);fwrite(hFile, var); format(var, 32, "%d pCashn", PlayerInfo[playerid][pCash]);fwrite(hFile, var); format(var, 32, "%d pAccountn", PlayerInfo[playerid][pAccount]);fwrite(hFile, var); format(var, 32, "%d pAdminn", PlayerInfo[playerid][pAdmin]);fwrite(hFile, var); format(var, 32, "%d pLeveln", PlayerInfo[playerid][pLevel]);fwrite(hFile, var); format(var, 32, "%d pExpn", PlayerInfo[playerid][pExp]);fwrite(hFile, var); format(var, 32, "%d gPupgraden", PlayerInfo[playerid][gPupgrade]);fwrite(hFile, var); format(var, 32, "%d pKillsn", PlayerInfo[playerid][pKills]);fwrite(hFile, var); format(var, 32, "%d pLJn", PlayerInfo[playerid][pLJ]);fwrite(hFile, var); format(var, 32, "%d pIJn", PlayerInfo[playerid][pIJ]);fwrite(hFile, var); format(var, 32, "%d pSRn", PlayerInfo[playerid][pSR]);fwrite(hFile, var); format(var, 32, "%d pWAn", PlayerInfo[playerid][pWA]);fwrite(hFile, var); format(var, 32, "%d pPENn", PlayerInfo[playerid][pPEN]);fwrite(hFile, var); format(var, 32, "%d pGun1n", PlayerInfo[playerid][pGun1]);fwrite(hFile, var); format(var, 32, "%d pGun2n", PlayerInfo[playerid][pGun2]);fwrite(hFile, var); format(var, 32, "%d pGun3n", PlayerInfo[playerid][pGun3]);fwrite(hFile, var); format(var, 32, "%d pGun4n", PlayerInfo[playerid][pGun4]);fwrite(hFile, var); format(var, 32, "%d pGun5n", PlayerInfo[playerid][pGun5]);fwrite(hFile, var); format(var, 32, "%d pGun6n", PlayerInfo[playerid][pGun6]);fwrite(hFile, var); format(var, 32, "%d pAmmo1n", PlayerInfo[playerid][pAmmo1]);fwrite(hFile, var); format(var, 32, "%d pAmmo2n", PlayerInfo[playerid][pAmmo2]);fwrite(hFile, var); format(var, 32, "%d pAmmo3n", PlayerInfo[playerid][pAmmo3]);fwrite(hFile, var); format(var, 32, "%d pAmmo4n", PlayerInfo[playerid][pAmmo4]);fwrite(hFile, var); format(var, 32, "%d pAmmo5n", PlayerInfo[playerid][pAmmo5]);fwrite(hFile, var); format(var, 32, "%d pAmmo6n", PlayerInfo[playerid][pAmmo6]);fwrite(hFile, var); format(var, 32, "%f pSHealthn", PlayerInfo[playerid][pSHealth]);fwrite(hFile, var); format(var, 32, "%f pHealthn", PlayerInfo[playerid][pHealth]);fwrite(hFile, var); format(var, 32, "%f pPos_xn", PlayerInfo[playerid][pPos_x]);fwrite(hFile, var); format(var, 32, "%f pPos_yn", PlayerInfo[playerid][pPos_y]);fwrite(hFile, var); format(var, 32, "%f pPos_zn", PlayerInfo[playerid][pPos_z]);fwrite(hFile, var); if(accountplay) { PlayerInfo[playerid][pInt] = 0; } format(var, 32, "%d pIntn", PlayerInfo[playerid][pInt]);fwrite(hFile, var); format(var, 32, "%d pLocaln", PlayerInfo[playerid][pLocal]);fwrite(hFile, var); format(var, 32, "%d pTeamn", PlayerInfo[playerid][pTeam]);fwrite(hFile, var); format(var, 32, "%d pModeln", PlayerInfo[playerid][pModel]);fwrite(hFile, var); format(var, 32, "%d pPnumbern", PlayerInfo[playerid][pPnumber]);fwrite(hFile, var); format(var, 32, "%d pPhousekeyn", PlayerInfo[playerid][pPhousekey]);fwrite(hFile, var); format(var, 32, "%d pPbiskeyn", PlayerInfo[playerid][pPbiskey]);fwrite(hFile, var); format(var, 32, "%d pGangn", PlayerInfo[playerid][pKills]);fwrite(hFile, var); format(var, 32, "%d pGleadern", PlayerInfo[playerid][pGleader]);fwrite(hFile, var); format(var, 32, "%d pServicen", PlayerInfo[playerid][pService]);fwrite(hFile, var); format(var, 32, "%d pSleadern", PlayerInfo[playerid][pSleader]);fwrite(hFile, var); format(var, 32, "%d pRealAdminn", PlayerInfo[playerid][pRealAdmin]);fwrite(hFile, var); format(var, 32, "%d pTOSn", PlayerInfo[playerid][pTOS]);fwrite(hFile, var); format(var, 32, "%d pJobn", PlayerInfo[playerid][pJob]);fwrite(hFile, var); format(var, 32, "%d pGLicensen", PlayerInfo[playerid][pGLicense]);fwrite(hFile, var); format(var, 32, "%d pDLicensen", PlayerInfo[playerid][pDLicense]);fwrite(hFile, var); format(var, 32, "%d pResignn", PlayerInfo[playerid][pResign]);fwrite(hFile, var); format(var, 32, "%d pFLicensen", PlayerInfo[playerid][pFLicense]);fwrite(hFile, var); format(var, 32, "%d pAlcaholn", PlayerInfo[playerid][pAlcahol]);fwrite(hFile, var); format(var, 32, "%d pDPointsn", PlayerInfo[playerid][pDPoints]);fwrite(hFile, var); format(var, 32, "%d pGPointsn", PlayerInfo[playerid][pGPoints]);fwrite(hFile, var); format(var, 32, "%d pSuspendedn", PlayerInfo[playerid][pSuspended]);fwrite(hFile, var); format(var, 32, "%d pPaycheckn", PlayerInfo[playerid][pPaycheck]);fwrite(hFile, var); format(var, 32, "%d pDrugsn", PlayerInfo[playerid][pDrugs]);fwrite(hFile, var); format(var, 32, "%d pResetn", PlayerInfo[playerid][pReset]);fwrite(hFile, var); format(var, 32, "%d pCKeyn", PlayerInfo[playerid][pCKey]);fwrite(hFile, var); format(var, 32, "%d pHotwiren", PlayerInfo[playerid][pHotwire]);fwrite(hFile, var); format(var, 32, "%d pDonationn", PlayerInfo[playerid][pDonation]);fwrite(hFile, var); format(var, 32, "%d pCLicensen", PlayerInfo[playerid][pCLicense]);fwrite(hFile, var); format(var, 32, "%d pStrengthn", PlayerInfo[playerid][pStrength]);fwrite(hFile, var); format(var, 32, "%d pTLicensen", PlayerInfo[playerid][pTLicense]);fwrite(hFile, var); fclose(hFile); GameTextForPlayer(playerid, "SERVER: Next time you connect type /login password to log in", 5000, 3); justreg[playerid] = 1; OnPlayerLogin(playerid,PlayerInfo[playerid][pPassword]); return 1; }
if (strcmp(cmd, "/login", true) ==0 ) { new tmppass[64]; if (gPlayerLogged[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /login [password]"); return 1; } strmid(tmppass, tmp, 0, strlen(cmdtext), 255); Encript(tmppass); if (gdebug){printf("DEBUG enterd %s", tmppass);} OnPlayerLogin(playerid,tmppass); return 1; }
Originally Posted by SilentHuntR
often times the "\r" or "\n" added to the line will add a character for each, so you'll need to strmid them from 0 to strlen -1. or using format ".*s" strlen(line)-1,line
[OFF-TOPIC] My shirt smells odd, not bad, but odd. Like the first time you walk into a friends house, there's always that instant wiff of "different" |