Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Mysql

$
0
0
hey guys i have problem in this code when i type it in game it down the server

PHP Code:

#if defined USE_STATS
CMD:stats(playerid,parmas[])
{
****new 
string[180], dialog_text[2000], pname[MAX_PLAYER_NAME], num_rowspdeathshmsuserid;
****if*(!
isnull(params))*playerid*=*strval(params);

****if*(
IsPlayerConnected(playerid))*{
********
TotalGameTime(playerid,*h,*m,*s);
********
GetPlayerName(playerid,*pname,*MAX_PLAYER_NAME);
********
********
format(dialog_text,*sizeof(dialog_text),*"\t\t\t\t"ccorange"YG*Stats*for*%s*(ID:%d)...",*PlayerName2(playerid),*playerid);*
********
format(dialog_text,*sizeof(dialog_text),*"%s\n\n"ccwhite"Kills:*"ccgreen"%d"ccwhite",*Deaths:*"ccgreen"%d*"ccwhite"-->*Ratio*of*"ccgreen"%0.2f*"ccwhite"kills*per*death,*Admin*kills:*"ccgreen"%d",dialog_text,*PlayerInfo[playerid][Kills],*PlayerInfo[playerid][Deaths],*Float:PlayerInfo[playerid][Kills]/Float:pDeaths,*PlayerInfo[playerid][AdminKills]);*
********
format(dialog_text,*sizeof(dialog_text),*"%s\n"ccwhite"YG*Status:*"ccgreen"%s"ccwhite",*TP*Status:*"ccgreen"%s"ccwhite",*Skin:*"ccgreen"%d"ccwhite",*Maths*Quiz*won:*"ccgreen"%d",dialog_text,*(PlayerInfo[playerid][YG]*==*0*?*("No")*:*("Yes")),*(PlayerInfo[playerid][TP]*==*0*?*("No")*:*("Yes")),*GetPlayerSkin(playerid),PlayerInfo[playerid][ReactionTestWon]);*
********
format(dialog_text,*sizeof(dialog_text),*"%s\n"ccwhite"Cookies:*"ccgreen"%d"ccwhite",*Cakes:*"ccgreen"%d"ccwhite",*Biscuits:*"ccgreen"%d"ccwhite",*Ice*Creames:*"ccgreen"%d"ccwhite",*Race*Won:*"ccgreen"%d",dialog_text,*PlayerInfo[playerid][Cookies],PlayerInfo[playerid][Cakes],PlayerInfo[playerid][Biscuits],PlayerInfo[playerid][IceCreams],*PlayerInfo[playerid][RaceWon]);*
********
format(dialog_text,*sizeof(dialog_text),*"%s\n"ccwhite"Money/Cash:*"ccgreen"$%d*"ccwhite"~*Banked*Money/Cash:*"ccgreen"$%d"ccwhite",*Total*Commands*Used:*"ccgreen"%d"ccwhite",*Total*Complaints:*"ccgreen"%d",dialog_text,*GetPlayerMoney(playerid),PlayerInfo[playerid][bank],PlayerInfo[playerid][Totcmdsused],PlayerInfo[playerid][pReports]);*
********
format(dialog_text,*sizeof(dialog_text),*"%s\n"ccwhite"Total*Logins:*"ccgreen"%d"ccwhite",*Total*Kicks:*"ccgreen"%d"ccwhite",*Total*Bans:*"ccgreen"%d"ccwhite",*Total*Warnings:*"ccgreen"%d",dialog_text,*PlayerInfo[playerid][Totallogins],PlayerInfo[playerid][Totalkicks],*PlayerInfo[playerid][Totalbans],*PlayerInfo[playerid][Totalwarnings]);*
********if*(
PlayerInfo[playerid][Level]*>*3)
************
format(dialog_text,*sizeof(dialog_text),*""ccwhite"Admin*level:*"ccgreen"%d"ccwhite",*VIP*level:*"ccgreen"0",PlayerInfo[playerid][Level]);
********else
************
format(dialog_text,*sizeof(dialog_text),*""ccwhite"Admin*level:*"ccgreen"0"ccwhite",*VIP*level:*"ccgreen"%d",PlayerInfo[playerid][Level]);
********
********
********
format(string,*sizeof(string),*"SELECT*RegisteredDate,*RegisteredTime,*LastOnlineDate,*LastOnlineTime,*id*FROM*`playerdata`*WHERE*`user`*=*'%s'*LIMIT*1",*pName(playerid));
********
mysql_query(string);
********
mysql_store_result();
********
********if*(
mysql_retrieve_row())
********{
************
mysql_fetch_field_row(string,*"id");*userid*=*strval(string);
************
format(dialog_text,*sizeof(dialog_text),*"%s\n"ccwhite"Played*"ccgreen"%d*"ccwhite"hours,*"ccgreen"%d*"ccwhite"minutes,*"ccgreen"%d*"ccwhite"seconds*~*User*ID:*"ccgreen"%d",dialog_text,*PlayerInfo[playerid][pHour],PlayerInfo[playerid][pMin],*PlayerInfo[playerid][pSec],*userid);*
************
format(dialog_text,*sizeof(dialog_text),*"%s\n"ccwhite"Playing*since*"ccgreen"%d*"ccwhite"hours,*"ccgreen"%d*"ccwhite"minutes,*"ccgreen"%d*"ccwhite"seconds*~*Wanted*Level:*"ccgreen"%d*",dialog_text,*h,*m,*s,*GetPlayerWantedLevel(playerid));*
************
mysql_fetch_field_row(string,*"RegisteredDate");
************
format(dialog_text,*sizeof(dialog_text),*"%s\n"ccwhite"RegisteredDate:*"ccgreen"%s*"ccwhite"~*",*dialog_text,*string);
************
mysql_fetch_field_row(string,*"RegisteredTime");
************
format(dialog_text,*sizeof(dialog_text),*"%sRegisteredTime:*"ccgreen"%s*"ccwhite"~*",*dialog_text,*string);
************
mysql_fetch_field_row(string,*"LastOnlineDate");
************
format(dialog_text,*sizeof(dialog_text),*"%sLastOnlineDate:*"ccgreen"%s*"ccwhite"~*",*dialog_text,*string);
************
mysql_fetch_field_row(string,*"LastOnlineTime");
************
format(dialog_text,*sizeof(dialog_text),*"%sLastOnlineTime:*"ccgreen"%s",*dialog_text,*string);
********}
********else
********{
************
format(dialog_text,*sizeof(dialog_text),*"%s\n"ccwhite"Played*"ccgreen"%d*"ccwhite"hours,*"ccgreen"%d*"ccwhite"minutes,*"ccgreen"%d*"ccwhite"seconds*~*User*ID:*"ccgreen"%d",dialog_text,*PlayerInfo[playerid][pHour],PlayerInfo[playerid][pMin],*PlayerInfo[playerid][pSec],*userid);*
************
format(dialog_text,*sizeof(dialog_text),*"%s\n"ccwhite"Playing*since*"ccgreen"%d*"ccwhite"hours,*"ccgreen"%d*"ccwhite"minutes,*"ccgreen"%d*"ccwhite"seconds*~*Wanted*Level:*"ccgreen"%d*",dialog_text,*h,*m,*s,*GetPlayerWantedLevel(playerid));*
************
format(dialog_text,*sizeof(dialog_text),*"%s\n"ccred_"Player*account*is*not*registered.",dialog_text);
********}
********
mysql_free_result();
********
********
ShowPlayerDialog(playerid,*2343,*DIALOG_STYLE_MSGBOX,*"Player*Status",*dialog_text,*"OK",*"");
****}
****else*return*
SendClientMessage(playerid,*red,*"Player*Not*Connected!");
****return*
1;
}* 

Help Please

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>