mysql problem
#5

This is the FULL OnPlayerConnect:

pawn Код:
public OnPlayerConnect(playerid)
{
    IsPlayerBanned(playerid);
    new query[128];
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    new IP[16];
    GetPlayerIp(playerid, IP, 16);
    mysql_format(mysql, query, sizeof(query),"SELECT * FROM `playerdata` WHERE `user` = '%e' LIMIT 1", name);
    mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
   
    MoneyGiven[playerid] = -1;
    JustLogged[playerid] = 0;
   
    SendDeathMessage(INVALID_PLAYER_ID,playerid, 200);
    SetPVarInt(playerid, "spawned", 0);
   
    StealingA69Prot[playerid] = 0;
    CapturingABAP[playerid] = 0;
    CapturingA69[playerid] = 0;
    CapturingHQ[playerid] = 0;
    CapturingBS[playerid] = 0;
    CapturingSFB[playerid] = 0;
    SpeedWarnings[playerid] = 0;
    ArmourWarnings[playerid] = 0;
    pAlive[playerid] = 0;
    pCheck[playerid] = 0;
    IsTakingOverTurf[playerid] = 0;
    RhinoKills[playerid] = 0;
    HydraKills[playerid] = 0;
    HunterKills[playerid] = 0;
    SeaSparrowKills[playerid] = 0;
    RustlerKills[playerid] = 0;
    cowit[playerid] = 0;
    killstreak[playerid] = 0;
   
    //==============Map Icons================================
    SetPlayerMapIcon(playerid,6, 388.7785,2481.7974,16.4844, 5, 0, MAPICON_GLOBAL); //Abandoned Airport
    SetPlayerMapIcon(playerid,7, 160.7681,1903.1256,18.7615, 6, 0, MAPICON_GLOBAL); //Area69
    SetPlayerMapIcon(playerid,8, 397.7717,858.3791,20.0455, 11, 0, MAPICON_GLOBAL); //Hunter Quarry
    SetPlayerMapIcon(playerid,9, -2498.7642,2359.2964,14.1182, 18, 0, MAPICON_GLOBAL); //Bayside
    SetPlayerMapIcon(playerid,10, -1400.9016,660.2661,34.5781, 20, 0, MAPICON_GLOBAL); //Red Gant Bridge
    SetPlayerMapIcon(playerid,12, 1602.0250,1435.7529,10.8261, 21, 0, MAPICON_GLOBAL); //LV Airport
   
    GangZoneShowForPlayer(playerid, Zone[AbandonedAp], 0xC0C0C075);
    GangZoneShowForPlayer(playerid, Zone[Area69], 0xC0C0C075);
    GangZoneShowForPlayer(playerid, Zone[HunterQuarry], 0xC0C0C075);
    GangZoneShowForPlayer(playerid, Zone[Bayside], 0xC0C0C075);
    GangZoneShowForPlayer(playerid, Zone[SFBridge], 0xC0C0C075);
    GangZoneShowForPlayer(playerid, Zone[LVAirport], 0xC0C0C075);

    TextDrawSetString(Sprite0, Sprites[random(sizeof(Sprites))]);
    TextDrawShowForPlayer(playerid,Sprite0);
   
    TextDrawShowForPlayer(playerid, WebSiteTxd);
    TextDrawShowForPlayer(playerid, LogoTxd);

    new joinMsg[110], lname[24];
    GetPlayerName(playerid, lname, sizeof(lname));
    format(joinMsg, sizeof(joinMsg), "3[%d]3 +++ %s has joined the server.", playerid, lname);
    IRC_GroupSay(gGroupID, IRC_CHANNEL, joinMsg);

    new ipschan[150];
    new IPP[40];
    GetPlayerIp(playerid, IPP, sizeof(IPP));
    format(ipschan, sizeof(ipschan), "** %s (%d) IP: %s - %s", name,playerid,IPP,InsertTimeStamp());
    dini_Set("/Logs/playerips.txt",name,IPP);
    JoinsLog(ipschan);
    IRC_GroupSay(gGroupID, IRC_IPCHANNEL, ipschan);
   
    new stats[128];
    format(stats, sizeof(stats), "UPDATE ServerStats SET TotalJoins = TotalJoins + 1");
    mysql_function_query(mConnectionHandle, stats, false, "", "");

    for( new i = 0; i <= 50; i ++ ) SCM(playerid,-1, "" );
    new welcome[250];
    format(welcome,sizeof(welcome),"{53C506}** {FFFFFF}Welcome to {F70505}%s - Please read /rules and /cmds {FFFFFF}for server info.",BUILD);
    SCM(playerid, -1, welcome);
    SCM(playerid,0xFF8080FF, "** Earn Battlefield Achievements (BA) to get extra score and money! Check /acinfo for more");
    SCM(playerid,0xFF8080FF, "** NOTICE: If you see anyone hacking please report it using /report [id] [reason]");
    return 1;
}
I don't see anything wrong.

IsPlayerBanned is the stock that check if the player is banned (stored in the "Bans" table.
Reply


Messages In This Thread
mysql problem - by Face9000 - 26.01.2014, 09:49
Re: mysql problem - by Misiur - 26.01.2014, 10:00
Re: mysql problem - by Face9000 - 26.01.2014, 10:01
Re: mysql problem - by Misiur - 26.01.2014, 10:16
Re: mysql problem - by Face9000 - 26.01.2014, 10:17
Re: mysql problem - by Misiur - 26.01.2014, 10:24
Re: mysql problem - by Face9000 - 26.01.2014, 10:30
Re: mysql problem - by Misiur - 26.01.2014, 10:37
Re: mysql problem - by Face9000 - 26.01.2014, 10:49
Re: mysql problem - by Misiur - 26.01.2014, 10:57

Forum Jump:


Users browsing this thread: 2 Guest(s)