SA-MP Forums Archive
[FilterScript] GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) (/showthread.php?tid=585036)

Pages: 1 2 3 4 5 6


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Kalashnecov - 07.03.2017

I registered, okay, so when soon again it says that my password is wrong even though it is right, and when I recover it my admin level is 0, and the GAdmins folder is in scriptfiles, what can it be?


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - iTzFireShark420 - 15.03.2017

please fix the login system


Respuesta: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Kaneki14 - 17.03.2017

Quote:

\filterscripts\gadmin.pwn(756) : error 029: invalid expression, assumed zero
\filterscripts\gadmin.pwn(756) : error 001: expected token: ")", but found ";"
\filterscripts\gadmin.pwn(756) : warning 215: expression has no effect
\filterscripts\gadmin.pwn(756) : error 001: expected token: ")", but found ";"
\filterscripts\gadmin.pwn(756) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Help me


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Gammix - 17.03.2017

New version will be posted soon!


Respuesta: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Kaneki14 - 18.03.2017

Quote:

for (new i, j = GetPlayerPoolSize(); i <= j; i++)

error -_-


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - dopeboy1040 - 09.05.2017

Code:
C:\Users\Ali Computer\Desktop\GAdmin\filterscripts\gadmin.pwn(30) : fatal error 100: cannot read from file: "spectate"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - dopeboy1040 - 09.05.2017

What About This Error When I compile Its Cant WithOut .amx File I cant Add this On my FS How i can add this can u send This .amx File?


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - dopeboy1040 - 09.05.2017



guzs see this when i load fs then its give me this


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - dopeboy1040 - 09.05.2017

http://imgur.com/a/IxSOo


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - MetalBeard - 10.07.2017

where is the filterscripts ?


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Wazowski - 20.07.2017

I'm using your server and it's great, but the 2/2 part to be admin I do not understand, could you explain? (I'm new)


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - KratosRoG - 22.11.2017

Quote:
Originally Posted by dopeboy1040
View Post
Code:
C:\Users\Ali Computer\Desktop\GAdmin\filterscripts\gadmin.pwn(30) : fatal error 100: cannot read from file: "spectate"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Same problem i have. where i can find this spectate inc?


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Ritzy2K - 22.11.2017

Quote:
Originally Posted by KratosRoG
View Post
Same problem i have. where i can find this spectate inc?
Click Me! Save this as spectate.inc in pawno/include and recompile.


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - billy1337samp - 22.11.2017

original:
PHP Code:
CMD:god(playerid)
{
    if (!
IsPlayerAdmin(playerid) && p_Account[playerid][E_ACCOUNT_ADMIN_LEVEL] < 1)
        return 
SendClientMessage(playeridCOLOR_TOMATO"Error: Only admin level 1 and above have access to this command.");
    if (!
p_Data[playerid][E_PDATA_GODMODE])
    {
        
SetPlayerHealth(playeridFLOAT_INFINITY);
        
GameTextForPlayer(playerid"~g~Godmode on"50003);
    }
    else
    {
        
SetPlayerHealth(playerid100.0);
        
GameTextForPlayer(playerid"~r~Godmode off"50003);
    }
    
p_Data[playerid][E_PDATA_GODMODE] = !p_Data[playerid][E_PDATA_GODMODE];
    
PlayerPlaySound(playerid10570.00.00.0);
    return 
1;

I don't know why but some admins may want to do the way I want to... If admin health = 20.00 and does /god then /god off, then their health will be 100.00. If you want the admins health to return back to 20.00 (or whatever amount it was) then use this:

at the top of the script add:
PHP Code:
Float:oldHealth[MAX_PLAYERS]; 
at CMD:god(playerid)
PHP Code:
CMD:god(playerid)
{
    if (!
IsPlayerAdmin(playerid) && p_Account[playerid][E_ACCOUNT_ADMIN_LEVEL] < 1)
        return 
SendClientMessage(playeridCOLOR_TOMATO"Error: Only admin level 1 and above have access to this command.");
    if (!
p_Data[playerid][E_PDATA_GODMODE])
    {
        
GetPlayerHealth(playeridoldHealth[playerid]);
        
SetPlayerHealth(playeridFLOAT_INFINITY);
        
GameTextForPlayer(playerid"~g~Godmode on"50003);
    }
    else
    {
        
SetPlayerHealth(playeridoldHealth[playerid]);
        
GameTextForPlayer(playerid"~r~Godmode off"50003);
    }
    
p_Data[playerid][E_PDATA_GODMODE] = !p_Data[playerid][E_PDATA_GODMODE];
    
PlayerPlaySound(playerid10570.00.00.0);
    return 
1;

basically grabs player health before it gets INFINITE and then after god mode is off it returns original health.


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Gammix - 22.11.2017

Quote:
Originally Posted by billy1337samp
View Post
original:
PHP Code:
CMD:god(playerid)
{
    if (!
IsPlayerAdmin(playerid) && p_Account[playerid][E_ACCOUNT_ADMIN_LEVEL] < 1)
        return 
SendClientMessage(playeridCOLOR_TOMATO"Error: Only admin level 1 and above have access to this command.");
    if (!
p_Data[playerid][E_PDATA_GODMODE])
    {
        
SetPlayerHealth(playeridFLOAT_INFINITY);
        
GameTextForPlayer(playerid"~g~Godmode on"50003);
    }
    else
    {
        
SetPlayerHealth(playerid100.0);
        
GameTextForPlayer(playerid"~r~Godmode off"50003);
    }
    
p_Data[playerid][E_PDATA_GODMODE] = !p_Data[playerid][E_PDATA_GODMODE];
    
PlayerPlaySound(playerid10570.00.00.0);
    return 
1;

I don't know why but some admins may want to do the way I want to... If admin health = 20.00 and does /god then /god off, then their health will be 100.00. If you want the admins health to return back to 20.00 (or whatever amount it was) then use this where it says CMD:god(playerid)
PHP Code:
CMD:god(playerid)
{
    new 
Float:oldHealth[MAX_PLAYERS];
    if (!
IsPlayerAdmin(playerid) && p_Account[playerid][E_ACCOUNT_ADMIN_LEVEL] < 1)
        return 
SendClientMessage(playeridCOLOR_TOMATO"Error: Only admin level 1 and above have access to this command.");
    if (!
p_Data[playerid][E_PDATA_GODMODE])
    {
        
GetPlayerHealth(playeridoldHealth[playerid]);
        
SetPlayerHealth(playeridFLOAT_INFINITY);
        
GameTextForPlayer(playerid"~g~Godmode on"50003);
    }
    else
    {
        
SetPlayerHealth(playeridoldHealth[playerid]);
        
GameTextForPlayer(playerid"~r~Godmode off"50003);
    }
    
p_Data[playerid][E_PDATA_GODMODE] = !p_Data[playerid][E_PDATA_GODMODE];
    
PlayerPlaySound(playerid10570.00.00.0);
    return 
1;

basically grabs player health before it gets INFINITE and then after god mode is off it returns original health.
This will actually kill when you yurn off godmode!
Either make the variable global or put "static FloatldHealth[MAX_PLAYERS];" instead of "new FloatldHealth[MAX_PLAYERS];"


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - KratosRoG - 23.11.2017

Quote:
Originally Posted by Ritzy
View Post
Click Me! Save this as spectate.inc in pawno/include and recompile.
Thank you man its work!


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Ritzy2K - 23.11.2017

Quote:
Originally Posted by Gammix
View Post
This will actually kill when you yurn off godmode!
Either make the variable global or put "static FloatldHealth[MAX_PLAYERS];" instead of "new FloatldHealth[MAX_PLAYERS];"
He declared a global variable in a command, won't New Float: OldHealth[playerid]; do the work?


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Gammix - 23.11.2017

Quote:
Originally Posted by Ritzy
View Post
He declared a global variable in a command, won't New Float: OldHealth[playerid]; do the work?
No, thats local variable! Everytime you run the command, a new oldHealth is declared.

Floats have a default value of 0.0 = death


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - Ritzy2K - 23.11.2017

Quote:
Originally Posted by Gammix
View Post
No, thats local variable! Everytime you run the command, a new oldHealth is declared.

Floats have a default value of 0.0 = death
Isn't the [MAX_PLAYERS] wasting too many cells? [playerid] would do the same work won't it? Yes I know that it's declared as local but the cell size is global.


Re: GAdmin v2 - Integrated form with many new features (0.3.7 R2-1+ only) - billy1337samp - 23.11.2017

So at the top it's
PHP Code:
 new Float:oldHealth[MAX_PLAYERS]; 
?
I would rather not use static as to be honest I'm not sure what it is, I'm still in learning pawn. But i'm sure it would work.

edit: I have edited that post


Or we could do it with pVars something like
PHP Code:
            new Float:health
PHP Code:
            GetPlayerHealth(playeridhealth);
            
SetPVarFloat(playerid"oldHealth"health); 
then on off godmode something like
PHP Code:
SetPlayerHealth(playeridGetPVarFloat(playerid"oldHealth")); 
right?

but last time i used pvars in a filterscript i got the response
Quote:
Originally Posted by Kaperstone
View Post
Why are you using PVar? You're sharing arrays with an unknown gamemode?
PVar is intended for it and you better not use it just like that because it is slower than using normal arrays.