[SetScore] Doesn't save the score when i quit game!!!
#1

Hi guys i got score command that i was using in my [GM] but suddenly it stoop working yesterday i give some play score and he quit and come back game + his score was 0 not saved i did to my self to check it it was true the score doesn't save here is the setscore code:

Quote:

dcmd_setscore(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, COLOR_CHARTREUSE, "Bilgilendirme: /setscore [playerid] [skor]");
new player1 = strval(tmp), ascore = strval(tmp2), string[128];
if(PlayerInfo[player1][Level] == 10 && PlayerInfo[playerid][Level] != 10) return SendClientMessage(playerid,red,"Hatali Komut: Bu komutu adminler ьzerinde kullanamazsiniz.");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
format(string, sizeof(string), "» sScore «: \"%s\" adli oyuncunun skorunu '%d' yaptin. ", pName(player1), ascore); SendClientMessage(playerid,COLOR_PINK,string);
if(player1 != playerid) { format(string,sizeof(string),"» sScore «: Admin \"%s\" senin skorunu(Score) '%d' yapti.", pName(playerid), ascore); SendClientMessage(player1,COLOR_PINK,string); SendClientMessage(player1,COLOR_TOMATO,"Not: Skorunun kayэtlanmasэnэ istiyorsan oyundan зэkэp tekrar girmelisin."); }
SetPlayerScore(player1, ascore); TabloGuncelle(player1);
PlayerInfo[player1][score] = GetPlayerScore(player1);
return 1;
} else return SendClientMessage(playerid,red,"Hatali Komut: Bu id'de bir oyuncu serverde bulunmamaktadir.");
} else return SendClientMessage(playerid,red,"Hatali Komut: Bu komut kaldэrэlmэюtэr.");
}

Reply
#2

I can't read that code. Use [pawn] BBCode tag.
Reply
#3

Here is the download link for that part i try the pastebin still mixed

http://www.mediafire.com/?oa8cj643zj4qojp
Reply
#4

OnPlayerDisconnect please.
Reply
#5

Код:
public OnPlayerDisconnect(playerid, reason)
{
    SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
    OyuncuEv[playerid] = -1;
	EvEditleniyor[GetHouseID(playerid)] = false;
	OyuncuKontrolEv[playerid]=-255;
    if(PlayerInfo[playerid][LoggedIn] == 1) SavePlayer(playerid);
 	dUserSetINT(PlayerName2(playerid)).("loggedin", 0);
    dUserSetINT(PlayerName2(playerid)).("score", PlayerInfo[playerid][score]);
    dUserSetINT(PlayerName2(playerid)).("money", PlayerInfo[playerid][money]);
    dUserSetINT(PlayerName2(playerid)).("money", GetPlayerMoney(playerid));
    objesilici(playerid);
    HizAc[playerid] = false;
    if((PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][Animator] >= 1) || PlayerInfo[playerid][Animator] >= 1){DestroyDynamic3DTextLabel(label1[playerid]);}
    if(Araba[playerid] == 1) if(!DestroyKontrol(ivehicle[playerid])) DestroyVehicle(ivehicle[playerid]), Araba[playerid] = 0;
    TextDrawHideForPlayer(playerid,esp[playerid]);
    TextDrawHideForPlayer(playerid, Arackomutlari);
	TextDrawHideForPlayer(playerid,Text:AltMenu);
	TextDrawHideForPlayer(playerid,Text:zx1);
	TextDrawHideForPlayer(playerid,Text:zx2);
	//TextDrawHideForPlayer(playerid,Text:AltMenu1);
	TextDrawHideForPlayer(playerid,Text:AltMenu3);
	TextDrawHideForPlayer(playerid, TextDraw1);
	TextDrawHideForPlayer(playerid, TextDraw2);
    TextDrawDestroy(esp[playerid]);
    TextDrawDestroy(Sayac[playerid]);
    karsitaraf[playerid] = 0;
    kayitbekle[playerid] = false;
    oyuncuuyarildi[playerid] = false;
    uyardim[playerid] = false;
	//raceWarnings[playerid] = 0;
	//Light Sistemi
    EklenenLight[playerid]=0;
	//-----------------------
	PlayerInfo[playerid][magnet] = 0;
    SetPlayerColor(playerid, COLOR_RED);
    DestroyDynamic3DTextLabel(Text2[playerid]);
    DestroyDynamic3DTextLabel(Text[playerid]);

    if(reason == 0) SQLServerInfo[sTimeouts]++;
	//savas sistemi
	//savasakatilmis[playerid] = 0;

	reportbirikim[playerid] = 0;
	ghostrider[playerid] = 0;
	Spectekiler[playerid] = 0;
	KillTimer(playertimer[playerid]);
	if(airb[playerid] == 1){
	DestroyVehicle(aircar[playerid]);
	DestroyObject(road[playerid]);
	}
	airb[playerid] = 0;

	IsInBus[playerid] = 0;
    InAmbu[playerid] = 0;
	Watching[playerid] = 0;
	Goto[playerid] = 0;
	yazdim[playerid] = 0;
	TextDrawHideForPlayer(playerid,Bilgi1[playerid]);
    TextDrawHideForPlayer(playerid,Bilgi2[playerid]);

	if(PlayerInfo[playerid][Jailed] == 1) KillTimer( JailTimer[playerid] );
	if(PlayerInfo[playerid][Frozen] == 1) KillTimer( FreezeTimer[playerid] );
	if(ServerInfo[Locked] == 1)	KillTimer( LockKickTimer[playerid] );

	if(PlayerInfo[playerid][pCar] != -1) CarDeleter(PlayerInfo[playerid][pCar]);

	#if defined ENABLE_SPEC
	for(new x=0; x<MAX_PLAYERS; x++)
	    if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && PlayerInfo[x][SpecID] == playerid)
   		   	AdvanceSpectate(x);
	#endif

    ResetPlayerInfo(playerid);

	gidisizni[playerid] = 0;

	new i2;
	for(i2=0;i2<MAX_VEHICLES;i2++)
	{
		if (locked[playerid][i2] == 1)
		{
			new i;
			for(i=0;i<MAX_PLAYERS;i++)
				{
  					SetVehicleParamsForPlayer(i2,i, 0, 0);
				}
		}
		locked[playerid][i2] = 0;
	}
    return 1;
}
Reply
#6

- Delete -
Reply
#7

Код:
dcmd_setscore(playerid,params[]) {
	if(IsPlayerAdmin(playerid)) {
	    new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
	    if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, COLOR_CHARTREUSE, "Bilgilendirme: /setscore [playerid] [skor]");
		new player1 = strval(tmp), ascore = strval(tmp2), string[128];
		if(PlayerInfo[player1][Level] == 10 && PlayerInfo[playerid][Level] != 10) return SendClientMessage(playerid,red,"Hatali Komut: Bu komutu adminler ьzerinde kullanamazsiniz.");
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
			format(string, sizeof(string), "» sScore «: \"%s\" adli oyuncunun skorunu '%d' yaptin. ", pName(player1), ascore); SendClientMessage(playerid,COLOR_PINK,string);
			if(player1 != playerid) { format(string,sizeof(string),"» sScore «: Admin \"%s\" senin skorunu(Score) '%d' yapti.", pName(playerid), ascore); SendClientMessage(player1,COLOR_PINK,string); SendClientMessage(player1,COLOR_TOMATO,"Not: Skorunun kayэtlanmasэnэ istiyorsan oyundan зэkэp tekrar girmelisin."); }
            SetPlayerScore(player1, ascore); TabloGuncelle(player1);
            PlayerInfo[player1][score] = GetPlayerScore(player1);
   			return 1;
	    } else return SendClientMessage(playerid,red,"Hatali Komut: Bu id'de bir oyuncu serverde bulunmamaktadir.");
 } else return SendClientMessage(playerid,red,"Hatali Komut: Bu komut kaldэrэlmэюtэr.");
}
Reply
#8

Quote:
Originally Posted by [Ro]DuReX
Посмотреть сообщение
- Delete -
Delete what?
Reply
#9

dUserSetINT(PlayerName2(playerid)).("score", GetPlayerScore(playerid));

He posted something, then wanted his post deleted.
Reply
#10

Do i have to delete this ?

dUserSetINT(PlayerName2(playerid)).("score", GetPlayerScore(playerid));
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)