Jump to content
  • 0

Problema Login Spawn


ionel03

Question

Problema intalnita (descriere):Salut !! Fac un edit unui prieten,si am o problema aceea este ca,cand intru pe server si detin o casa nu ma da la casa ci trb sa accesez cmd /spawnchange si as vrea sa schimb ca atunci cand te loghezi sa te de-a la casa si ca sa te de-a la spawn dai /spawnchange.
Ero(area / rile) / warning-(ul / urile):Nu am
Liniile de cod / sursa / script-ul(obligatoriu):

Spoiler

public OnPlayerLogin(playerid,password[])
{
	new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    new qstr[100];
    new result[456];
    format(qstr,100,"SELECT * FROM users WHERE `name`='%s' AND `password`='%s'",playername2,password);
    mysql_query(SQL,qstr);
    mysql_store_result();
    if(mysql_num_rows() > 0)
    {
      	if(mysql_retrieve_row())
      	{
    		mysql_fetch_field_row(result,"Parole"); format(PlayerInfo[playerid][pKey], 128, result);
			mysql_fetch_field_row(result,"Nivel"); PlayerInfo[playerid][pLevel] = strval( result );
			mysql_fetch_field_row(result,"Admin"); PlayerInfo[playerid][pAdmin] = strval( result );
			mysql_fetch_field_row(result,"Helper"); PlayerInfo[playerid][pHelper] = strval( result );
			mysql_fetch_field_row(result,"Premium"); PlayerInfo[playerid][pPremiumAccount] = strval( result );
			mysql_fetch_field_row(result,"ConnectedTime"); PlayerInfo[playerid][pConnectTime] = strval( result );
			mysql_fetch_field_row(result,"Registered"); PlayerInfo[playerid][pReg] = strval( result );
			mysql_fetch_field_row(result,"Sex"); PlayerInfo[playerid][pSex] = strval( result );
			mysql_fetch_field_row(result,"AgAni"); PlayerInfo[playerid][pAge] = strval( result );
			mysql_fetch_field_row(result,"Origin"); PlayerInfo[playerid][pOrigin] = strval( result );
			mysql_fetch_field_row(result,"Muted"); PlayerInfo[playerid][pMuted] = strval( result );
			mysql_fetch_field_row(result,"Mutetime"); PlayerInfo[playerid][pMuteTime] = strval( result );
			mysql_fetch_field_row(result,"Respect"); PlayerInfo[playerid][pExp] = strval( result );
			mysql_fetch_field_row(result,"Money"); PlayerInfo[playerid][pCash] = strval( result );
			mysql_fetch_field_row(result,"Bank"); PlayerInfo[playerid][pAccount] = strval( result );
			mysql_fetch_field_row(result,"Crimes"); PlayerInfo[playerid][pCrimes] = strval( result );
			mysql_fetch_field_row(result,"Kills"); PlayerInfo[playerid][pKills] = strval( result );
			mysql_fetch_field_row(result,"Deaths"); PlayerInfo[playerid][pDeaths] = strval( result );
			mysql_fetch_field_row(result,"Arrested"); PlayerInfo[playerid][pArrested] = strval( result );
			mysql_fetch_field_row(result,"WantedDeaths"); PlayerInfo[playerid][pWantedDeaths] = strval( result );
			mysql_fetch_field_row(result,"Phonebook"); PlayerInfo[playerid][pPhoneBook] = strval( result );
			mysql_fetch_field_row(result,"LottoNr"); PlayerInfo[playerid][pLottoNr] = strval( result );
			mysql_fetch_field_row(result,"WantedLevel"); PlayerInfo[playerid][pWantedLevel] = strval( result );
			mysql_fetch_field_row(result,"Fishes"); PlayerInfo[playerid][pFishes] = strval( result );
			mysql_fetch_field_row(result,"RFishes"); PlayerInfo[playerid][pRFishes] = strval( result );
			mysql_fetch_field_row(result,"Job"); PlayerInfo[playerid][pJob] = strval( result );
			mysql_fetch_field_row(result,"Paycheck"); PlayerInfo[playerid][pPayCheck] = strval( result );
			mysql_fetch_field_row(result,"HeadValue"); PlayerInfo[playerid][pHeadValue] = strval( result );
			mysql_fetch_field_row(result,"Jailed"); PlayerInfo[playerid][pJailed] = strval( result );
			mysql_fetch_field_row(result,"JailTime"); PlayerInfo[playerid][pJailTime] = strval( result );
			mysql_fetch_field_row(result,"Materials"); PlayerInfo[playerid][pMats] = strval( result );
			mysql_fetch_field_row(result,"Drugs"); PlayerInfo[playerid][pDrugs] = strval( result );
			mysql_fetch_field_row(result,"Leader"); PlayerInfo[playerid][pLeader] = strval( result );
			mysql_fetch_field_row(result,"Member"); PlayerInfo[playerid][pMember] = strval( result );
			mysql_fetch_field_row(result,"Rank"); PlayerInfo[playerid][pRank] = strval( result );
			mysql_fetch_field_row(result,"CChar"); PlayerInfo[playerid][pChar] = strval( result );
			mysql_fetch_field_row(result,"FWarn"); PlayerInfo[playerid][pFACWarns] = strval( result );
			mysql_fetch_field_row(result,"FPunish"); PlayerInfo[playerid][pFpunish] = strval( result );
			mysql_fetch_field_row(result,"Acceptpoints"); PlayerInfo[playerid][pLawyer] = strval( result );
			mysql_fetch_field_row(result,"SexSkill"); PlayerInfo[playerid][pSexSkill] = strval( result );
			mysql_fetch_field_row(result,"MechSkill"); PlayerInfo[playerid][pMechSkill] = strval( result );
			mysql_fetch_field_row(result,"NewsSkill"); PlayerInfo[playerid][pNewsSkill] = strval( result );
			mysql_fetch_field_row(result,"DrugsSkill"); PlayerInfo[playerid][pDrugsSkill] = strval( result );
			mysql_fetch_field_row(result,"FishSkill"); PlayerInfo[playerid][pFishSkill] = strval( result );
			mysql_fetch_field_row(result,"MatSkill"); PlayerInfo[playerid][pMatSkill] = strval( result );
			mysql_fetch_field_row(result,"RobSkill"); PlayerInfo[playerid][pRobSkill] = strval( result );
	        mysql_fetch_field_row(result,"pHealth"); PlayerInfo[playerid][pHealth] = floatstr( result );
	        mysql_fetch_field_row(result,"Inter"); PlayerInfo[playerid][pInt] = strval( result );
	        mysql_fetch_field_row(result,"Local"); PlayerInfo[playerid][pLocal] = strval( result );
	        mysql_fetch_field_row(result,"Team"); PlayerInfo[playerid][pTeam] = strval( result );
	        mysql_fetch_field_row(result,"Model"); PlayerInfo[playerid][pModel] = strval( result );
	        mysql_fetch_field_row(result,"PhoneNr"); PlayerInfo[playerid][pPnumber] = strval( result );
	        mysql_fetch_field_row(result,"House"); PlayerInfo[playerid][pPhousekey] = strval( result );
	        mysql_fetch_field_row(result,"Bizz"); PlayerInfo[playerid][pPbiskey] = strval( result );
	        mysql_fetch_field_row(result,"Radio"); PlayerInfo[playerid][pRadioCars] = strval( result );
	        mysql_fetch_field_row(result,"Status"); PlayerInfo[playerid][pStatus] = strval( result );
	        mysql_fetch_field_row(result,"Pos_x"); PlayerInfo[playerid][pPos_x] = floatstr( result );
	        mysql_fetch_field_row(result,"Pos_y"); PlayerInfo[playerid][pPos_y] = floatstr( result );
	        mysql_fetch_field_row(result,"Pos_z"); PlayerInfo[playerid][pPos_z] = floatstr( result );
	        mysql_fetch_field_row(result,"Rob"); PlayerInfo[playerid][pRob] = strval( result );
	        mysql_fetch_field_row(result,"CarLicT"); PlayerInfo[playerid][pCarLicT] = strval( result );
	        mysql_fetch_field_row(result,"CarLic"); PlayerInfo[playerid][pCarLic] = strval( result );
	        mysql_fetch_field_row(result,"FlyLicT"); PlayerInfo[playerid][pFlyLicT] = strval( result );
	        mysql_fetch_field_row(result,"FlyLic"); PlayerInfo[playerid][pFlyLic] = strval( result );
	        mysql_fetch_field_row(result,"BoatLicT"); PlayerInfo[playerid][pBoatLicT] = strval( result );
	        mysql_fetch_field_row(result,"BoatLic"); PlayerInfo[playerid][pBoatLic] = strval( result );
	        mysql_fetch_field_row(result,"FishLicT"); PlayerInfo[playerid][pFishLicT] = strval( result );
	        mysql_fetch_field_row(result,"FishLic"); PlayerInfo[playerid][pFishLic] = strval( result );
	        mysql_fetch_field_row(result,"GunLicT"); PlayerInfo[playerid][pGunLicT] = strval( result );
	        mysql_fetch_field_row(result,"GunLic"); PlayerInfo[playerid][pGunLic] = strval( result );
	        mysql_fetch_field_row(result,"PayDay"); PlayerInfo[playerid][pPayDay] = strval( result );
	        mysql_fetch_field_row(result,"PayDayHad"); PlayerInfo[playerid][pPayDayHad] = strval( result );
	        mysql_fetch_field_row(result,"Tutorial"); PlayerInfo[playerid][pTut] = strval( result );
	        mysql_fetch_field_row(result,"Warnings"); PlayerInfo[playerid][pWarns] = strval( result );
	        mysql_fetch_field_row(result,"SpawnChange"); PlayerInfo[playerid][pSpawnChange] = strval( result );
			mysql_fetch_field_row(result,"GPoints"); PlayerInfo[playerid][pGPoints] = strval( result );
	        mysql_fetch_field_row(result,"Rented"); PlayerInfo[playerid][pRented] = strval( result );
	        mysql_fetch_field_row(result,"Fuel"); PlayerInfo[playerid][pFuel] = strval( result );
			mysql_fetch_field_row(result,"Calls"); PlayerInfo[playerid][pCalls] = strval( result );
			mysql_fetch_field_row(result,"SMS"); PlayerInfo[playerid][pSMS] = strval( result );
	        mysql_fetch_field_row(result,"Married"); PlayerInfo[playerid][pMarried] = strval( result );
	        mysql_fetch_field_row(result,"MarriedTo"); strmid(PlayerInfo[playerid][pMarriedTo], result, 0, strlen(result), 255);
	        mysql_fetch_field_row(result,"WTalkie"); PlayerInfo[playerid][pWTalkie] = strval( result );
	        mysql_fetch_field_row(result,"Lighter"); PlayerInfo[playerid][pLighter] = strval( result );
	        mysql_fetch_field_row(result,"Cigarettes"); PlayerInfo[playerid][pCigarettes] = strval( result );
	        mysql_fetch_field_row(result,"Tow"); PlayerInfo[playerid][pTow] = strval( result );
			mysql_fetch_field_row(result,"Email"); strmid(PlayerInfo[playerid][pEmail], result, 0, strlen(result), 255);
			mysql_fetch_field_row(result,"RegisterDate"); strmid(PlayerInfo[playerid][pRegistredDate], result, 0, strlen(result), 255);
	        mysql_fetch_field_row(result,"Banned"); PlayerInfo[playerid][pBanned] = strval( result );
            mysql_fetch_field_row(result,"ClanTag"); strmid(PlayerInfo[playerid][pClanTag], result, 0, strlen(result), 255);
            mysql_fetch_field_row(result,"Clan"); PlayerInfo[playerid][pClan] = strval( result );
            mysql_fetch_field_row(result,"Radio2"); PlayerInfo[playerid][pRadio] = strval( result );
            mysql_fetch_field_row(result,"HitT"); PlayerInfo[playerid][pHitT] = strval( result );
            mysql_fetch_field_row(result,"CRank"); PlayerInfo[playerid][pCRank] = strval( result );
			mysql_fetch_field_row(result,"Phone"); PlayerInfo[playerid][pPhone] = strval( result );
			mysql_fetch_field_row(result,"referralp"); PlayerInfo[playerid][pReferralP] = strval( result );
	        mysql_fetch_field_row(result,"Carkey"); PlayerInfo[playerid][pPcarkey] = strval( result );
			mysql_fetch_field_row(result,"motokey"); PlayerInfo[playerid][pmotokey] = strval( result );
			mysql_fetch_field_row(result,"helikey"); PlayerInfo[playerid][phelikey] = strval( result );
			mysql_fetch_field_row(result,"prcarkey"); PlayerInfo[playerid][pprcarkey] = strval( result );
			mysql_fetch_field_row(result,"Laptop"); PlayerInfo[playerid][pLaptop] = strval( result );
            mysql_fetch_field_row(result,"Victim"); strmid(PlayerInfo[playerid][pVictim], result, 0, strlen(result), 255);
            mysql_fetch_field_row(result,"Accused"); strmid(PlayerInfo[playerid][pAccused], result, 0, strlen(result), 255);
			mysql_fetch_field_row(result,"Crime1"); strmid(PlayerInfo[playerid][pCrime1], result, 0, strlen(result), 255);
			mysql_fetch_field_row(result,"Crime2"); strmid(PlayerInfo[playerid][pCrime2], result, 0, strlen(result), 255);
			mysql_fetch_field_row(result,"Crime3"); strmid(PlayerInfo[playerid][pCrime3], result, 0, strlen(result), 255);
			mysql_fetch_field_row(result,"BTemp"); PlayerInfo[playerid][pBTemp] = strval( result );
			mysql_fetch_field_row(result,"BYear"); PlayerInfo[playerid][pBYear] = strval( result );
			mysql_fetch_field_row(result,"BMonth"); PlayerInfo[playerid][pBMonth] = strval( result );
			mysql_fetch_field_row(result,"BDay"); PlayerInfo[playerid][pBDay] = strval( result );
			mysql_fetch_field_row(result,"BBy"); strmid(PlayerInfo[playerid][pBBy], result, 0, strlen(result), 255);
			mysql_fetch_field_row(result,"BReason"); strmid(PlayerInfo[playerid][pBReason], result, 0, strlen(result), 255);
			mysql_fetch_field_row(result,"Fakea"); PlayerInfo[playerid][pFakea] = strval( result );
			mysql_fetch_field_row(result,"ALeader"); PlayerInfo[playerid][pALeader] = strval( result );
	   	}
	}
	else
	{
		new loginstring[128];
		new loginname[64];
		GetPlayerName(playerid,loginname,sizeof(loginname));
		format(loginstring,sizeof(loginstring),"Wrong password\n\nPlease rewrite!!!.",loginname);
		ShowPlayerDialog(playerid,DIALOG_LOGIN3,DIALOG_STYLE_PASSWORD,"Login",loginstring,"Login","Quit");
        mysql_free_result();
        gPlayerLogTries[playerid] += 1;
        if(gPlayerLogTries[playerid] == 3)
		{
			KickEx(playerid);
		}
        return 1;
	}
	mysql_free_result();
	ResetPlayerCash(playerid);
	GivePlayerCash(playerid,PlayerInfo[playerid][pCash]);
	CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
	new wakaname[MAX_PLAYER_NAME];
 	PlayerInfo[playerid][pStatus] = 1;
 	new qqerry[128];
 	GetPlayerName(playerid,wakaname,sizeof(wakaname));
 	format(qqerry, sizeof(qqerry), "UPDATE `users` SET `Status` = '1' WHERE `name` = '%s'", wakaname);
  	mysql_query(SQL,qqerry);
	TempBanCheck(playerid);
	if(PlayerInfo[playerid][pReg] == 0)
	{
		PlayerInfo[playerid][pLevel] = 2;
		PlayerInfo[playerid][pHealth] = 100.0;
 	    PlayerInfo[playerid][pPos_x] = 2246.6;
 	    PlayerInfo[playerid][pPos_y] = -1161.9;
 	    PlayerInfo[playerid][pPos_z] = 1029.7;
		PlayerInfo[playerid][pInt] = 0;
		PlayerInfo[playerid][pLocal] = 255;
		PlayerInfo[playerid][pTeam] = 3;
		PlayerInfo[playerid][pModel] = 29;
		new randphone = 1000 + random(8999)
		PlayerInfo[playerid][pPnumber] = randphone;
		PlayerInfo[playerid][pPhousekey] = 999;
		PlayerInfo[playerid][pPbiskey] = 255;
		PlayerInfo[playerid][pAccount] = 10000;
		PlayerInfo[playerid][pPcarkey] = 0;
		PlayerInfo[playerid][pmotokey] = 0;
		PlayerInfo[playerid][phelikey] = 0;
		PlayerInfo[playerid][pprcarkey] = 0;
		PlayerInfo[playerid][pReg] = 1;
		PlayerInfo[playerid][pRadioCars] = 1;
		SetPlayerInterior(playerid,0);
		new string[300];
		new d,m,y;
		getdate(y,m,d);
		new h,mine,s;
		gettime(h,mine,s);
		format(string,sizeof(string),  "%d/%d/%d %d:%d:%d",d,m,y,h,mine,s);
		strmid(PlayerInfo[playerid][pRegistredDate], string, 0, strlen(string), 255);
		new str[256];
		GetPlayerName(playerid,wakaname,sizeof(wakaname));
		format(str,sizeof(str),"UPDATE users SET `pHealth`='100.0',`Team`='3',`Model`='29',`Radio`='1' WHERE `name`='%s'",wakaname);
		mysql_query(SQL,str);
		Update(playerid,pCashx);
		Update(playerid,pLevelx);
		Update(playerid,pPhousekeyx);
		Update(playerid,pPbiskeyx);
		Update(playerid,pPnumberx);
		Update(playerid,pRegx);
		Update(playerid,pRegistredDatex);
		Update(playerid,pPcarkeyx);
		Update(playerid,pmotokeyx);
		Update(playerid,phelikeyx);
		Update(playerid,pprcarkeyx);
	}
	if(PlayerInfo[playerid][pBanned] == 1) //autoban
	{
        SCM(playerid, COLOR_LIGHTRED, "[BAN INFO]: You have ban on this server!");
        SCM(playerid, COLOR_LIGHTRED, "[BAN INFO]: Please make a unban request");
		Ban(playerid);
	}
    StopAudioStreamForPlayer(playerid);
    new string2[128];
    if(PlayerInfo[playerid][pTut] == 1)
    {
		format(string2, sizeof(string2), "Welcome, %s!",playername2);
		SCM(playerid, 0xE6E6E6E6,string2);
	}
	SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
	
	if (PlayerInfo[playerid][pPremiumAccount] == 1)
	{
		SCM(playerid, 0xE6E6E6E6,"YOU logged with PREMIUM User!");
	}
	if (PlayerInfo[playerid][pAdmin] > 0)
	{
		format(string2, sizeof(string2), "You loggeed at admin level %d.",PlayerInfo[playerid][pAdmin]);
		SCM(playerid, 0xE6E6E6E6,string2);
	}
	if (PlayerInfo[playerid][pHelper] > 0)
	{
		format(string2, sizeof(string2),"You loggeed at helper %d!", PlayerInfo[playerid][pHelper]);
		SCM(playerid, 0xE6E6E6E6,string2);
	}
	if (PlayerInfo[playerid][pWantedLevel] > 0)
	{
		format(string2, sizeof(string2), "You have %d wanted stars!",PlayerInfo[playerid][pWantedLevel]);
		SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel]);
		TogglePlayerSpectating(playerid, 0);
		SCM(playerid, COLOR_LIGHTRED, string2);
		wantedlost[playerid] = 1800;
		WantedPoints[playerid] = PlayerInfo[playerid][pWantedLevel]*2;
	}
	SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], 2112.1138,1287.9967,10.8203,252.0659, -1, -1, -1, -1, -1, -1);
	
	if(gTeam[playerid] == 0)
	{
		gTeam[playerid] = 3;
	}
	else
	{
		gTeam[playerid] = PlayerInfo[playerid][pTeam];
	}
	if(PlayerInfo[playerid][pMember] != 0)
	{
	    new namex[25],disc[84];
	    GetPlayerName(playerid,namex,sizeof(namex));
	    format(disc,sizeof(disc),"Faction member %s will logeed!",namex);
	    SendLeaderMessage(PlayerInfo[playerid][pMember], COLOR_YELLOW, disc);
	}
	if(PlayerInfo[playerid][pMember] != 0)
	{
		if(strlen(DynamicFactions[PlayerInfo[playerid][pMember]][fAnn]) > 0)
		{
		    new factioninfo[128];
			format(factioninfo,sizeof(factioninfo), "(Faction News) %s",DynamicFactions[PlayerInfo[playerid][pMember]][fAnn]);
			SCM(playerid,0xAA3333FF,factioninfo);
		}
	}
	new sendername[25],playersip[64],iplog[184];
	GetPlayerName(playerid,sendername,sizeof(sendername));
	GetPlayerIp(playerid,playersip,sizeof(playersip));
	LogIP(playersip,PlayerInfo[playerid][pSQLID]);
	TogglePlayerSpectating(playerid, 0);
	format(iplog,sizeof(iplog),"{5CAD5C}%s(%d) connected on the server with IP: %s.",sendername,playerid,playersip);
	SendIP(COLOR_WHITE,iplog);
	gPlayerLogged[playerid] = 1;
	SpawnPlayer(playerid);
	format(qqerry, sizeof(qqerry), "UPDATE `users` SET `Status` = '1',`Radio` = '1' WHERE `name` = '%s'", sendername);
    mysql_query(SQL,qqerry);
	printf("%s has logged in with IP %s.",sendername,playersip);
	Starts0bCheck(playerid,0);
	
	
	return 1;
}

 

Spoiler

CMD:spawnchange(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_LIGHTRED, "Nu esti logat!");
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pPhousekey] != 999)
        {
            if(PlayerInfo[playerid][pSpawnChange])
            {
                SCM(playerid, COLOR_WHITE,"Veti fi spamat de acum in factiunea / hq-ul dumneavoastra.");
                PlayerInfo[playerid][pSpawnChange] = 0;
                Update(playerid, pSpawnChangex);
            }
            else
            {
                SCM(playerid, COLOR_WHITE, "Vei fi spamat de acum la casa /chiria dumneavoastra.");
                PlayerInfo[playerid][pSpawnChange] = 1;
                Update(playerid, pSpawnChangex);
            }
        }
        else return SCM(playerid,COLOR_WHITE,"You do not have a home.");
    }
    return 1;
}


Imagini / Video (optional):-
Ati incercat sa rezolvati singur?: Da ,am incercat sa fac comanda /changespawn,am cautat tutoriale etc

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Pune la final la OnPlayerSpawn;

if(PlayerInfo[playerid][pSpawnChange] == 1)
		    {
				SetPlayerToTeamColor(playerid);
				SetPlayerInterior(playerid,HouseInfo[house][hInterior]);
				SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); 
                SetPlayerVirtualWorld(playerid, HouseInfo[house][hVirtual]);
				PlayerInfo[playerid][pLocal] = house;
				PlayerInfo[playerid][pInt] = HouseInfo[house][hInterior];
				InHouse[playerid] = house;
				return 1;
			}
		}

 

Link to comment
Share on other sites

  • 0
  • 0
Spoiler

public OnPlayerSpawn(playerid)
{
    StopAudioStreamForPlayer(playerid);
	SetPlayerHealthEx(playerid, 100);
    SetPlayerArmourEx(playerid, 0);
    TextDrawShowForPlayer(playerid, DigiHP[playerid]);
    SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
	
	new wakaname[25];
	GetPlayerName(playerid,wakaname,25);
	new query[MAX_PLAYERS];
    new Float:Armura;
	GetPlayerArmour(playerid, Armura);
	if(Armura >= 1) TextDrawShowForPlayer(playerid, DigiAP[playerid]);
	else TextDrawHideForPlayer(playerid, DigiAP[playerid]);
    SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel]);
    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
	if(!gPlayerAnimLibsPreloaded[playerid])
	{
   		PreloadAnimLib(playerid,"BOMBER");
   		PreloadAnimLib(playerid,"RAPPING");
    	PreloadAnimLib(playerid,"SHOP");
   		PreloadAnimLib(playerid,"BEACH");
   		PreloadAnimLib(playerid,"SMOKING");
    	PreloadAnimLib(playerid,"FOOD");
    	PreloadAnimLib(playerid,"ON_LOOKERS");
    	PreloadAnimLib(playerid,"DEALER");
    	PreloadAnimLib(playerid,"MISC");
    	PreloadAnimLib(playerid,"SWEET");
    	PreloadAnimLib(playerid,"RIOT");
    	PreloadAnimLib(playerid,"PED");
    	PreloadAnimLib(playerid,"POLICE");
		PreloadAnimLib(playerid,"CRACK");
		PreloadAnimLib(playerid,"CARRY");
		PreloadAnimLib(playerid,"COP_AMBIENT");
		PreloadAnimLib(playerid,"PARK");
		PreloadAnimLib(playerid,"INT_HOUSE");
		PreloadAnimLib(playerid,"FOOD");
		gPlayerAnimLibsPreloaded[playerid] = 1;
	}
	STDPlayer[playerid] = 0;
	if(gTeam[playerid] == 4)
	{
		gTeam[playerid] = 4;
	}
	if(JoinedDeathMatch[playerid] > 0)
	{
		JoinedDeathMatch[playerid] = 0;
		ResetPlayerWeapons(playerid);
	}
    if(PlayerInfo[playerid][pMember] == 0)
	{
	    gTeam[playerid] = 3;
    	PlayerInfo[playerid][pTeam] = 3;
    	format(query, sizeof(query), "UPDATE users SET Model='%d' WHERE `name`='%s'", PlayerInfo[playerid][pModel], PlayerInfo[playerid],wakaname);
	    mysql_query(SQL, query);
    	format(query, sizeof(query), "UPDATE users SET CChar='%d' WHERE `name`='%s'", PlayerInfo[playerid][pChar], PlayerInfo[playerid],wakaname);
    	mysql_query(SQL, query);
	}
	else if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 7)
	{
	    gTeam[playerid] = 2;
    	PlayerInfo[playerid][pTeam] = 2;
    	format(query, sizeof(query), "UPDATE users SET Model='%d' WHERE `name`='%s'", PlayerInfo[playerid][pModel], PlayerInfo[playerid],wakaname);
	    mysql_query(SQL, query);
    	format(query, sizeof(query), "UPDATE users SET CChar='%d' WHERE `name`='%s'", PlayerInfo[playerid][pChar], PlayerInfo[playerid],wakaname);
    	mysql_query(SQL, query);
	}
	else if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 10)
	{
	    gTeam[playerid] = 5;
    	PlayerInfo[playerid][pTeam] = 5;
    	format(query, sizeof(query), "UPDATE users SET Model='%d' WHERE `name`='%s'", PlayerInfo[playerid][pModel], PlayerInfo[playerid],wakaname);
	    mysql_query(SQL, query);
    	format(query, sizeof(query), "UPDATE users SET CChar='%d' WHERE `name`='%s'", PlayerInfo[playerid][pChar], PlayerInfo[playerid],wakaname);
    	mysql_query(SQL, query);
	}
	else if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pMember] == 14)
	{
	    gTeam[playerid] = 4;
    	PlayerInfo[playerid][pTeam] = 4;
    	format(query, sizeof(query), "UPDATE users SET Model='%d' WHERE `name`='%s'", PlayerInfo[playerid][pModel], PlayerInfo[playerid],wakaname);
	    mysql_query(SQL, query);
    	format(query, sizeof(query), "UPDATE users SET CChar='%d' WHERE `name`='%s'", PlayerInfo[playerid][pChar], PlayerInfo[playerid],wakaname);
    	mysql_query(SQL, query);
	}
	else if(PlayerInfo[playerid][pMember] == 11)
	{
	    gTeam[playerid] = 11;
    	PlayerInfo[playerid][pTeam] = 11;
    	format(query, sizeof(query), "UPDATE users SET Model='%d' WHERE `name`='%s'", PlayerInfo[playerid][pModel], PlayerInfo[playerid],wakaname);
	    mysql_query(SQL, query);
    	format(query, sizeof(query), "UPDATE users SET CChar='%d' WHERE `name`='%s'", PlayerInfo[playerid][pChar], PlayerInfo[playerid],wakaname);
    	mysql_query(SQL, query);
	}
	if(PlayerInfo[playerid][pChar] > 0 )
	{
		SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
	}
	else
	{
		SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
	}
	if(gPlayerLogged[playerid] == 0)
	{
    	SCM(playerid, COLOR_LIGHTRED, "** This server requires a Login BEFORE spawn (Kicked) **");
    	Kick(playerid);
		return 1;
 	}
	if(PlayerInfo[playerid][pChar] > 0 ) { SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]); }
	else { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); }
	SetPlayerSpawn(playerid);
	SetPlayerToTeamColor(playerid);
	playerdeath[playerid] = 0;
	SetPlayerTeam(playerid,4);
	
	if(gym[playerid] == 1 && IsAMexic(playerid))
    { 
        SetPlayerInterior(playerid,10);
		SetPlayerPos(playerid,-974.3441,1061.3531,1345.6741);
		PlayerInfo[playerid][pInt] = 10;
		SetPlayerVirtualWorld(playerid, 6);
		GivePlayerWeaponEx(playerid,24,999);
		GivePlayerWeaponEx(playerid,24,999);
		GivePlayerWeaponEx(playerid,8,1);
		GivePlayerWeaponEx(playerid,29,999);
		GivePlayerWeaponEx(playerid,29,999);
		GivePlayerWeaponEx(playerid,31,999);
		GivePlayerWeaponEx(playerid,31,999);
		
    } 
	if(gym[playerid] == 1)
	{
		SetPlayerInterior(playerid,10);
        SetPlayerPos(playerid,-974.3441,1061.3531,1345.6741);
        PlayerInfo[playerid][pInt] = 10;
        SetPlayerVirtualWorld(playerid, 2);
        GivePlayerWeaponEx(playerid,24,999);
		GivePlayerWeaponEx(playerid,24,999);
		GivePlayerWeaponEx(playerid,8,1);
		GivePlayerWeaponEx(playerid,29,999);
		GivePlayerWeaponEx(playerid,29,999);
		GivePlayerWeaponEx(playerid,31,999);
		GivePlayerWeaponEx(playerid,31,999);
	}
	if(gym[playerid] == 1)
	{
		SetPlayerInterior(playerid,10);
        SetPlayerPos(playerid,-974.3441,1061.3531,1345.6741);
        PlayerInfo[playerid][pInt] = 10;
        SetPlayerVirtualWorld(playerid, 3);
		GivePlayerWeaponEx(playerid,24,999);
		GivePlayerWeaponEx(playerid,24,999);
		GivePlayerWeaponEx(playerid,8,1);
		GivePlayerWeaponEx(playerid,29,999);
		GivePlayerWeaponEx(playerid,29,999);
		GivePlayerWeaponEx(playerid,31,999);
		GivePlayerWeaponEx(playerid,31,999);
	}
	if(gym[playerid] == 1)
	{
		SetPlayerInterior(playerid,10);
        SetPlayerPos(playerid,-974.3441,1061.3531,1345.6741);
        PlayerInfo[playerid][pInt] = 10;
        SetPlayerVirtualWorld(playerid, 4);
		GivePlayerWeaponEx(playerid,24,999);
		GivePlayerWeaponEx(playerid,24,999);
		GivePlayerWeaponEx(playerid,8,1);
		GivePlayerWeaponEx(playerid,29,999);
		GivePlayerWeaponEx(playerid,29,999);
		GivePlayerWeaponEx(playerid,31,999);
		GivePlayerWeaponEx(playerid,31,999);
	}
	return 1;
}

 

Aici

Link to comment
Share on other sites

  • 0
  • 0

Nu am acele 2 verificari !!

Uite tot ce am in gm despre spawnchange(tin sa precizez ca este tabel in DB cu spawn change)

Spoiler

#define pSpawnChangex       55

pSpawnChange,

 

Spoiler

case pSpawnChangex:
				{
					format(var, sizeof(var), "UPDATE `users` SET `SpawnChange`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pSpawnChange], playerName);
					mysql_query(SQL ,var);
				}


if(PlayerInfo[playerid][pSpawnChange])
		    {
				SetPlayerToTeamColor(playerid);
				SetPlayerInterior(playerid,HouseInfo[house][hInterior]);
				SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); 
                SetPlayerVirtualWorld(playerid, HouseInfo[house][hVirtual]);
				PlayerInfo[playerid][pLocal] = house;
				PlayerInfo[playerid][pInt] = HouseInfo[house][hInterior];
				InHouse[playerid] = house;
				
		        
				return 1;
			}
		}

 

Spoiler

mysql_fetch_field_row(result,"SpawnChange"); PlayerInfo[playerid][pSpawnChange] = strval( result );







CMD:spawnchange(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_LIGHTRED, "Nu esti logat!");
    if(IsPlayerConnected(playerid))
    {
	    if(PlayerInfo[playerid][pPhousekey] != 999)
        {
            if(PlayerInfo[playerid][pSpawnChange])
            {
                SCM(playerid, COLOR_WHITE,"Veti fi spamat de acum in factiunea / hq-ul dumneavoastra.");
                PlayerInfo[playerid][pSpawnChange] = 0;
                Update(playerid, pSpawnChangex);
            }
            else
            {
                SCM(playerid, COLOR_WHITE, "Vei fi spamat de acum la casa /chiria dumneavoastra.");
                PlayerInfo[playerid][pSpawnChange] = 1;
                Update(playerid, pSpawnChangex);
            }
        }
        else return SCM(playerid,COLOR_WHITE,"Nu ai o casa.");
    }
    return 1;
}

 

TOT ce am legat in gm de spawnchange

Edited by ionel03
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.