OnPlayerCommandPerformed Bug
#1

I'm trying to make for who didn't login can't use any commands but it not working.. please help me.. when i use /rules commands it still pop up this is the script
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
        SendClientMessage(playerid,-1,""red"[SERVER]: "white"Unknown Command!");
        PlayerPlaySound(playerid,1149,0.0,0.0,0.0);
    }
    if(!IsPlayerLogged(playerid)) return SendClientMessage(playerid,-1,""red"[SERVER]: "white"You must login to use any commands!");
    return 1;
}
IsPlayerLogged code
pawn Код:
stock IsPlayerLogged(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new file[256], tmp2;

format(file,256,"/ultrax/Users/%s.ini",name);
tmp2 = dini_Int(file,"Logged");

if((IsPlayerConnected(playerid)) && (tmp2 == 1) )
return true;
else return false;
}
Reply
#2

Do you have the "Logged" stat set to 1 somewhere in the script?
Reply
#3

Quote:
Originally Posted by DTV
Посмотреть сообщение
Do you have the "Logged" stat set to 1 somewhere in the script?
yes. i put in on my admin fs .. my include working fine because the client message is sent but the command still popping up..

sorry for my bad english
Reply
#4

Show what part of the code that is and where it's being called.
Reply
#5

Quote:
Originally Posted by DTV
Посмотреть сообщение
Show what part of the code that is and where it's being called.
PHP код:
function Login(playerid,inputtext[]){
    
dini_IntSet(userfile(playerid),"Logged"1);
    
AccInfo[playerid][Password] = dini_Int(userfile(playerid),"Password");
    
dini_Set(userfile(playerid), "IP"GetIP(playerid));
    
strcat(AccInfo[playerid][IP], dini_Get(userfile(playerid), "IP"));
    
AccInfo[playerid][Logged] = 1;
    
AccInfo[playerid][Regged] = 1;
    
AccInfo[playerid][Skin] = dini_Int(userfile(playerid),"Skin");
    
AccInfo[playerid][Money] = dini_Int(userfile(playerid),"Money");
    
AccInfo[playerid][Admin] = dini_Int(userfile(playerid),"Admin");
    
AccInfo[playerid][VIP] = dini_Int(userfile(playerid),"VIP");
    
AccInfo[playerid][DJ] = dini_Int(userfile(playerid),"DJ");
    
AccInfo[playerid][Death] = dini_Int(userfile(playerid),"Death");
    
AccInfo[playerid][Kill] = dini_Int(userfile(playerid),"Kill");
    
AccInfo[playerid][Jailed] = dini_Int(userfile(playerid),"Jailed");
    
AccInfo[playerid][Banned] = dini_Int(userfile(playerid),"Banned");
    
AccInfo[playerid][Stream] = dini_Int(userfile(playerid),"Stream");
    if(
AccInfo[playerid][Banned] == 1){ SendClientMessage(playerid,-1,""red"[SERVER]: "white"You're account has been banned."); return SetTimerEx("KickPlayer",3000,false,"i",playerid); }
    
SpawnPlayer(playerid);
    return 
1;

Reply
#6

Код:
AccInfo[playerid][Logged] = 1;
I see this stat, assuming that it's tied to being logged in, you could try checking to see if this stat is equal to 1.
Reply
#7

Quote:
Originally Posted by DTV
Посмотреть сообщение
Код:
AccInfo[playerid][Logged] = 1;
I see this stat, assuming that it's tied to being logged in, you could try checking to see if this stat is equal to 1.
it working .. i'm already check user file
Reply
#8

Well, where do you have the Login function called at?
Reply
#9

Admin FS will not pass variables to the Gamemode... You need to read up on how that portion of scripting works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)