if u dont login u get kicked dont work
#1

ONplayerspawn
pawn Code:
public OnPlayerSpawn(playerid)
{
    new englandcp;
    new russiancp;
    new file[26];
    SetPlayerInterior(playerid, 0);
    englandcp = CreateDynamicCP(247.9255,1859.3064,14.0840, 2, -1, -1, -1);
    russiancp = CreateDynamicCP(-340.0471,1543.2358,75.5625, 2, -1, -1, -1);
    if(!dini_Exists(file))
    {
        SendClientMessage(playerid, -1, "You need to login");
        PInfo[playerid][Preg] =1;
        PInfo[playerid][Ploged] =0;
        PInfo[playerid][Banned] =0;
        Kick(playerid);
        return 1;
    }
    return 1;
}
its not working if i login it still kicks me
Reply
#2

file isn't formated...
Ex:
pawn Code:
format(file, sizeof file, "%s.ini",PlayerName);
Reply
#3

i formatted it now but still kicks me when i login
Reply
#4

The file has been created?

Show your new code
Reply
#5

pawn Code:
new englandcp;
    new russiancp;
    SetPlayerInterior(playerid, 0);
    englandcp = CreateDynamicCP(247.9255,1859.3064,14.0840, 2, -1, -1, -1);
    russiancp = CreateDynamicCP(-340.0471,1543.2358,75.5625, 2, -1, -1, -1);
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file),"FatAdmin/Users/%s.ini,name");
    if(!dini_Exists(file))
    {
        SendClientMessage(playerid, -1, "You need to login");
        PInfo[playerid][Preg] =1;
        PInfo[playerid][Ploged] =0;
        PInfo[playerid][Banned] =0;
        Kick(playerid);
        return 1;
    }
    return 1;
}
Reply
#6

Replace
pawn Code:
format(file, sizeof(file),"FatAdmin/Users/%s.ini,name");
pawn Code:
//new file[44];
format(file, sizeof(file),"FatAdmin/Users/%s.ini",name);
Reply
#7

maybe OnPlayerSpawn
pawn Code:
if (PInfo[playerid][Ploged] == 0) return Kick(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)