saving player time and weather
#7

Doesn't work, tried to create another table in MySQL database such as time and time2, still don't load my time. Even tho, it saves correctly on my database from phpmyadmin, I can see the exact same time saved. But struggle on loading it.

This is the command:

PHP код:
CMD:settime(playeridparams[])
{
    if(
connected[playerid] == true) return GameTextForPlayer(playerid"~r~Spawn First"50005);
    new 
str[50], timequery[250];
    if(
sscanf(params"i"time)) return SendClientMessage(playerid, -1"{c3c3c3}/settime [time]");
    if(
time || time 50)
    {
        
SendClientMessage(playerid, -1"{c3c3c3}/settime [time]");
        return 
1;
    }
    
SetPlayerTime(playeridtimetime);
    
format(strsizeof(str), "{c3c3c3}(time) Time set to %d"time);
    
SendClientMessage(playerid, -1str);
     
mysql_format(g_SQLquerysizeof query"UPDATE `players` SET `time` = '%d' WHERE `id` = '%d' LIMIT 1"timepInfo[playerid][ID]);
     
mysql_tquery(g_SQLquery);
     
mysql_format(g_SQLquerysizeof query"UPDATE `players` SET `time2` = '0' WHERE `id` = '%d' LIMIT 1"timepInfo[playerid][ID]);
     
mysql_tquery(g_SQLquery);
    return 
1;

I made time2 = minutes to set it to 0, because I don't care about minutes. I want to make it simply as that, no need to add additional numbers while changing own time.

PHP код:
stock LoadTime(playerid){
cache_get_value_int(0"time"pInfo[playerid][Time]);
cache_get_value_int(0"time2"pInfo[playerid][Time2]);
SetPlayerTime(playerid,pInfo[playerid][Time], pInfo[playerid][Time2]);
return 
1;} 
Something wrong there...
Reply


Messages In This Thread
saving player time and weather - by severance - 15.08.2018, 17:10
Re: saving player time and weather - by OMonger - 15.08.2018, 18:56
Re: saving player time and weather - by severance - 15.08.2018, 19:13
Re: saving player time and weather - by OMonger - 15.08.2018, 21:05
Re: saving player time and weather - by severance - 15.08.2018, 21:23
Re: saving player time and weather - by OMonger - 15.08.2018, 21:29
Re: saving player time and weather - by severance - 16.08.2018, 10:54

Forum Jump:


Users browsing this thread: 1 Guest(s)