Help for Script of Register/login for RP
#1

Hello World !
I want create a register system for my RP server, I test 10 Hours for repare my system and i'm block :/


My errors :
Quote:

D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3830) : warning 217: loose indentation
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3830) : error 029: invalid expression, assumed zero
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3830) : error 004: function "OnPlayerDisconnect" is not implemented
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3833) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3834) : warning 217: loose indentation
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3834) : warning 219: local variable "name" shadows a variable at a preceding level
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3836) : warning 215: expression has no effect
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3839) : error 001: expected token: ";", but found "if"
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3839) : error 017: undefined symbol "reason"
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3839) : warning 215: expression has no effect
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3839) : error 001: expected token: ";", but found ")"
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3839) : fatal error 107: too many error messages on one line

My script :
Quote:

3830 ublic OnPlayerDisconnect(playerid, reason)
3831 :{
3832 :
3833 :new string[500];
3834 :new name[MAX_PLAYER_NAME];
3835 :GetPlayerName(playerid, name, sizeof(name));
3836 :idx5;
3837 :idx5 = strfind (name, "_");
3838 :name[idx5] = ' '
3839 :if(reason = 0)
3840 :{
3841 :format(string, sizeof(string), "%s a quittй Evolution Life. (Crash)", name);
3842 :SendClientMessageToAll(COLOR_GREY, string);
3843 rint(string);
3844 :PlayerInfo[playerid][pCrashed] = 1;
3845 :}
3846 :else if(reason = 1)
3847 :{
3848 :format(string, sizeof(string), "%s a quittй Evolution Life. (Quittй)", name);
3849 :SendClientMessageToAll(COLOR_GREY, string);
3850 rint(string);
3851 :}
3852 :else if(reason = 2)
3853 :{
3854 :format(string, sizeof(string), "%s a quittй Une Evolution Life. (Kicked/Banned)", name);
3855 :SendClientMessageToAll(COLOR_GREY, string);
3856 rint(string);
3857 :}
3858 layeripused --;
3859 :
3860 :KillTimer(resettimer[playerid]);
3861 :gActivePlayers[playerid]--;
3862 :numplayers--;
3863 ://if(reason == 0)
3864 ://{
3865 :for(new slot = 0; slot != 12; slot++)
3866 :{
3867 :new wep, ammo;
3868 :GetPlayerWeaponData(playerid, slot, wep, ammo);
3869 :if(wep != 0 && ammo != 0)
3870 :{
3871 :if(PlayerInfo[playerid][pGun1] == 0) { PlayerInfo[playerid][pGun1] = wep; PlayerInfo[playerid][pAmmo1] = ammo; }
3872 :else if(PlayerInfo[playerid][pGun2] == 0) { PlayerInfo[playerid][pGun2] = wep; PlayerInfo[playerid][pAmmo2] = ammo; }
3873 :else if(PlayerInfo[playerid][pGun3] == 0) { PlayerInfo[playerid][pGun3] = wep; PlayerInfo[playerid][pAmmo3] = ammo; }
3874 :else if(PlayerInfo[playerid][pGun4] == 0) { PlayerInfo[playerid][pGun4] = wep; PlayerInfo[playerid][pAmmo4] = ammo; }
3875 :}
3876 :new Float:Xa,Float:Ya,Float:Za;
3877 :new Interior;
3878 :new VirWorld;
3879 :VirWorld = GetPlayerVirtualWorld(playerid);
3880 :Interior = GetPlayerInterior(playerid);
3881 :GetPlayerPos(playerid, Xa,Ya,Za);
3882 :PlayerInfo[playerid][pPos_x] = Xa;
3883 :PlayerInfo[playerid][pPos_y] = Ya;//acv
3884 :PlayerInfo[playerid][pPos_z] = Za;
3885 :PlayerInfo[playerid][pInt] = Interior;
3886 :PlayerInfo[playerid][pVirWorld] = VirWorld;
3887 :}
3888 :return 1;
3889 :}

Help me please ... Thank you.

PS: I'm a french people and I don't use "****** Traduction" ^^

EDIT : Pwno tags don't start so I place number lines.
Reply
#2

Can you tell us where line 3830, 3833, 3834, 3836 & 3839 are?

I can see some errors but maybe it's good if you point them out and use [PAWNO][/PAWNO] tags instead of quoting it all.
Reply
#3

I edit my post and i add number lines
Reply
#4

Loose indentation warnings are just dodgy tabbing.

Make sure all codeblocks ( { to } ) are one tab in from it's parent codeblock:

pawn Код:
myfunction();
{
    if(a>b)
    {
        //Bla
    }
}
______
pawn Код:
3839 :if(reason = 0)
You need to use '==' in place of '=' within if statements. = is to set, == is to compare.

Make it
pawn Код:
if(reason == 0)
______
pawn Код:
3836 :idx5;
To declare a new variable, you MUST use "new" first.

pawn Код:
new idx5;
______
The first error you are getting is usually the result of a missing closing bracket. remove all coding from your OnPlayerDisconnect function and paste it into a notepad file. If it does not compile, it means another codeblock was not terminated.
Reply
#5

New errors :

Quote:

D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3830) : error 029: invalid expression, assumed zero
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3830) : error 004: function "OnPlayerDisconnect" is not implemented
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3833) : warning 219: local variable "string" shadows a variable at a preceding level
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3834) : warning 219: local variable "name" shadows a variable at a preceding level
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3836) : warning 219: local variable "idx5" shadows a variable at a preceding level
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3839) : error 001: expected token: ";", but found "if"
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3839) : error 017: undefined symbol "reason"
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3846) : error 017: undefined symbol "reason"
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\SERVER\Base\filterscripts\registerbydragaf eanddefect.pwn(3852) : error 017: undefined symbol "reason"

New Lines :

Quote:

3830 : public OnPlayerDisconnect(playerid, reason)
3831 : {
3832 :
3833 : new string[500];
3834 : new name[MAX_PLAYER_NAME];
3835 : GetPlayerName(playerid, name, sizeof(name));
3836 : new idx5;
3837 : idx5 = strfind (name, "_");
3838 : name[idx5] = ' '
3839 : if(reason == 0)
3840 : {
3841 : format(string, sizeof(string), "%s a quittй Evolution-Life. (Crash)", name);
3842 : SendClientMessageToAll(COLOR_GREY, string);
3843 : print(string);
3844 : PlayerInfo[playerid][pCrashed] = 1;
3845 : }
3846 : else if(reason == 1)
3847 : {
3848 : format(string, sizeof(string), "%s a quittй Evolution-Life. (Quittй)", name);
3849 : SendClientMessageToAll(COLOR_GREY, string);
3850 : print(string);
3851 : }
3852 : else if(reason == 2)
3853 : {
3854 : format(string, sizeof(string), "%s a quittй Evolution-Life. (Kicked/Banned)", name);
3855 : SendClientMessageToAll(COLOR_GREY, string);
3856 : print(string);
3857 : }
3858 : playeripused --;
3859 :
3860 : KillTimer(resettimer[playerid]);
3861 : gActivePlayers[playerid]--;
3862 : numplayers--;
3863 : //if(reason == 0)
3864 : //{
3865 : for(new slot = 0; slot != 12; slot++)
3866 : {
3867 : new wep, ammo;
3868 : GetPlayerWeaponData(playerid, slot, wep, ammo);
3869 : if(wep != 0 && ammo != 0)
3870 : {
3871 : if(PlayerInfo[playerid][pGun1] == 0) { PlayerInfo[playerid][pGun1] = wep; PlayerInfo[playerid][pAmmo1] = ammo; }
3872 : else if(PlayerInfo[playerid][pGun2] == 0) { PlayerInfo[playerid][pGun2] = wep; PlayerInfo[playerid][pAmmo2] = ammo; }
3873 : else if(PlayerInfo[playerid][pGun3] == 0) { PlayerInfo[playerid][pGun3] = wep; PlayerInfo[playerid][pAmmo3] = ammo; }
3874 : else if(PlayerInfo[playerid][pGun4] == 0) { PlayerInfo[playerid][pGun4] = wep; PlayerInfo[playerid][pAmmo4] = ammo; }
3875 : }
3876 : new Float:Xa,Float:Ya,Float:Za;
3877 : new Interior;
3878 : new VirWorld;
3879 : VirWorld = GetPlayerVirtualWorld(playerid);
3880 : Interior = GetPlayerInterior(playerid);
3881 : GetPlayerPos(playerid, Xa,Ya,Za);
3882 : PlayerInfo[playerid][pPos_x] = Xa;
3883 : PlayerInfo[playerid][pPos_y] = Ya;//acv
3884 : PlayerInfo[playerid][pPos_z] = Za;
3885 : PlayerInfo[playerid][pInt] = Interior;
3886 : PlayerInfo[playerid][pVirWorld] = VirWorld;
3887 : }
3888 : return 1;
3889 : }

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)