21.04.2012, 14:37
(
Последний раз редактировалось SanAndreasVille; 21.04.2012 в 19:04.
)
Hello i want make a command /stats an want sehh my kills an deaths
i saved my data @ logout with this script:
on Connect
how can i make a command to see my kills and deaths
#Code editet
i saved my data @ logout with this script:
Код:
public OnPlayerDisconnect(playerid,reason) { if(GetPVarInt(playerid, "Logged") == 1) { format(Query, sizeof(Query), "UPDATE `playerinfo` SET `score` = '%d',`money` = '%d', `kills` = '%d', `deaths` = '%d' WHERE `user` = '%s'", GetPlayerScore(playerid), GetPlayerMoney(playerid), GetPVarInt(playerid, "Kills"), GetPVarInt(playerid, "Deaths"), escpname(playerid)); mysql_query(Query); }
Код:
public OnPlayerConnect(playerid) { bancheck(playerid); GetPlayerIp(playerid, PIP, 18); format(Query, sizeof(Query), "SELECT * FROM `playerinfo` WHERE `user` = '%s' LIMIT 1", escpname(playerid), PIP); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() != 0) { new PIP2[18]; mysql_fetch_field_row(PIP2, "IP"); if(!strcmp(PIP, PIP2, true) && strlen(PIP2) != 0) { SetPVarInt(playerid, "Logged", 1); SendClientMessage(playerid, 0x009600AA, "Auto Logged in!"); if(mysql_fetch_row(line)) { new data[3][55]; new data2[5]; sscanf(line, "p<|>s[50]s[300]dddds[50]ds[100]", data[0], largestring, data2[0], data2[1], data2[2], data2[3], data[2], data2[4], estring); stringempty(estring); stringempty(largestring); SetPVarInt(playerid, "Kills", data2[0]); SetPVarInt(playerid, "Logged", 1); SetPVarInt(playerid, "Deaths", data2[1]); SetPlayerScore(playerid, data2[2]); GivePlayerMoney(playerid, data2[3]); SetPVarInt(playerid, "AdminLevel", data2[4]); mysql_free_result(); } } else { SendClientMessage(playerid, 0x009600AA, "This account is registered, please login"); ShowPlayerDialog(playerid, 15000, DIALOG_STYLE_INPUT , "Login", "This account is registered, please login", "OK", "Cancel"); } } else { ShowPlayerDialog(playerid, 14600, DIALOG_STYLE_INPUT , "Register", "This account is not registered, please register!", "OK", "Cancel"); SendClientMessage(playerid, 0x009600AA, "This account is not registered, please register!"); } mysql_free_result(); return 1; }
#Code editet