16.03.2011, 13:00
Hey, i have problem. Gives the skin, not my choice, but given the default skin
Spawn:
Load:
Spawn:
Код:
public OnPlayerSpawn(playerid){ //Animaciju uzkrovimas | Visada PreloadAnimLib(playerid,"ON_LOOKERS"); PreloadAnimLib(playerid,"ped"); PreloadAnimLib(playerid, "BEACH"); PreloadAnimLib(playerid, "benchpress"); PreloadAnimLib(playerid, "CAR"); PreloadAnimLib(playerid, "CAMERA"); PreloadAnimLib(playerid, "COP_AMBIENT"); PreloadAnimLib(playerid, "DODGE"); PreloadAnimLib(playerid, "POLICE"); PreloadAnimLib(playerid, "PARK"); PreloadAnimLib(playerid, "GRAVEYARD"); PreloadAnimLib(playerid, "KISSING"); PreloadAnimLib(playerid, "GANGS"); PreloadAnimLib(playerid, "DAM_JUMP"); PreloadAnimLib(playerid, "MISC"); PreloadAnimLib(playerid, "HEIST9"); PreloadAnimLib(playerid, "PAULNMAC"); PreloadAnimLib(playerid, "VENDING"); if(playerDB[playerid][vedelogin] == false){SendClientMessage(playerid,BLUE,"* Norint pasirinkti skiną reiktų prisijungti!!");Kick(playerid); return 0;} //Save ikelimas | Jei zaidejas prisijunge if(playerDB[playerid][authstate]==2) { LoadPlayerData(playerid); playerDB[playerid][authstate]=4; }else{ if(!playerDB[playerid][uniformd]) { playerDB[playerid][drabuziai] = GetPlayerSkin(playerid); playerDB[playerid][lytis] = GetGender(playerDB[playerid][drabuziai]); } else { SetPlayerSkin(playerid, playerDB[playerid][uniforma]); playerDB[playerid][lytis] = GetGender(playerDB[playerid][uniforma]); } } if(playerDB[playerid][naujokas]==true) { GivePlayerMoneyA(playerid,6000); SetPlayerScore(playerid,400); playerDB[playerid][drabuziai] = GetPlayerSkin(playerid); SetPlayerPos(playerid,-1957.4478,149.5514,27.6875); } ///Givybes ir lytis | Jei zaidejas jau buvo prisijunges arba uzsiregistravo if(playerDB[playerid][authstate]!=2) { SetPlayerHealth(playerid,50.0); if(playerDB[playerid][uniformd]) { SetPlayerSkin(playerid, playerDB[playerid][uniforma]); } } //Spalva ir patvirtinimas | Jei zaidejas ka tik uzsiregistravo ar prisijunge if(playerDB[playerid][authstate] <2) { playerDB[playerid][authstate]=3; } //Jei zaidejas mire kalejime arba paliko zaidima budamas ten, jis grizta if (playerDB[playerid][ikalintas]) { JailPlayer(playerid,269.2385,1816.4769,1.0078,0,playerDB[playerid][kalejimo_laikas]*1000,0,-1605.4492,712.8993,13.7835,358.9595,0,true); } return 1; }
Код:
public LoadPlayerData(playerid) { new resultline[ 1024 ], fetch[ 258 ], query[1024], tmpa ; format(query, 1024,"SELECT * FROM `"TABLENAME"` WHERE id = '%i'",playerDB[playerid][SQLID]); mysql_query(query); mysql_store_result(); mysql_fetch_row(resultline); GameTextForPlayer(playerid,"~r~] Kraunamas Tavo zaidimas ]",50000,5); new Float:Coo[3] ; mysql_fetch_field_row(fetch,"pos_X"); Coo[0] = floatstr(fetch); mysql_fetch_field_row(fetch,"pos_Y"); Coo[1] = floatstr(fetch); mysql_fetch_field_row(fetch,"pos_Z"); Coo[2] = floatstr(fetch); SetPlayerPos(playerid,Coo[0],Coo[1],Coo[2]); mysql_fetch_field_row(fetch,"xp"); new tmplygis; sscanf(fetch, "i", tmplygis); SetPlayerScore(playerid, tmplygis); // mysql_fetch_field_row(fetch,"World"); new tmpworld; sscanf(fetch, "i", tmpworld); SetPlayerVirtualWorld(playerid, tmpworld); // mysql_fetch_field_row(fetch,"Interior"); new tmpinterior; sscanf(fetch, "i", tmpinterior); SetPlayerInterior(playerid, tmpinterior); // mysql_fetch_field_row(fetch,"Money_Pocket"); ResetPlayerMoneyA(playerid); new tmpmoney; sscanf(fetch, "i", tmpmoney); GivePlayerMoneyA(playerid, tmpmoney); // mysql_fetch_field_row(fetch,"Wanted"); new tmpwanted; sscanf(fetch, "i", tmpwanted); SetPlayerWantedLevel(playerid, tmpwanted); // mysql_fetch_field_row(fetch,"Money_Bank"); sscanf(fetch, "i", tmpa); playerDB[playerid][banke] = tmpa; // mysql_fetch_field_row(fetch,"Mobsas"); sscanf(fetch, "i", tmpa); playerDB[playerid][mobsas] = tmpa; // mysql_fetch_field_row(fetch,"Alga"); sscanf(fetch, "i", tmpa); playerDB[playerid][alga] = tmpa; // mysql_fetch_field_row(fetch,"Money_Home"); sscanf(fetch, "i", tmpa); playerDB[playerid][namuose] = tmpa; // mysql_fetch_field_row(fetch,"Drugs"); sscanf(fetch, "i", tmpa); playerDB[playerid][narkotikai] = tmpa; // mysql_fetch_field_row(fetch,"Insurance"); sscanf(fetch, "i", tmpa); playerDB[playerid][draudimas] = tmpa; // mysql_fetch_field_row(fetch,"Lytis"); sscanf(fetch, "i", tmpa); playerDB[playerid][lytis] = tmpa; // mysql_fetch_field_row(fetch,"mokesciai"); sscanf(fetch, "i", tmpa); playerDB[playerid][mokesciai] = tmpa; // mysql_fetch_field_row(fetch,"Skinas"); sscanf(fetch, "i", tmpa); playerDB[playerid][drabuziai] = tmpa; // mysql_fetch_field_row(fetch,"Uniforma"); sscanf(fetch, "i", tmpa); playerDB[playerid][uniforma] = tmpa; // mysql_fetch_field_row(fetch,"Lead"); sscanf(fetch, "i", tmpa); playerDB[playerid][plead] = tmpa; // mysql_fetch_field_row(fetch,"Kalejime"); sscanf(fetch, "i", tmpa); playerDB[playerid][kalejimo_laikas] = tmpa; // mysql_fetch_field_row(fetch,"Job"); sscanf(fetch, "i", tmpa); playerDB[playerid][specialybe] = tmpa; // mysql_fetch_field_row(fetch,"Biznis"); sscanf(fetch, "i", tmpa); playerDB[playerid][biznis] = tmpa; // mysql_fetch_field_row(fetch,"Pastatas"); sscanf(fetch, "i", tmpa); playerDB[playerid][cbuilding] = tmpa; // mysql_fetch_field_row(fetch,"Kreditai"); sscanf(fetch, "i", tmpa); playerDB[playerid][kreditai] = tmpa; // mysql_fetch_field_row(fetch,"vlaikas"); sscanf(fetch, "i", tmpa); playerDB[playerid][vlaikas] = tmpa; // mysql_fetch_field_row(fetch,"Praleista"); sscanf(fetch, "i", tmpa); playerDB[playerid][praleista] = tmpa; // new weps[2][12] ; mysql_fetch_field_row(fetch,"Ginklas0"); sscanf(fetch, "i", weps[0][0]); mysql_fetch_field_row(fetch,"Ginklas1"); sscanf(fetch, "i", weps[0][1]); mysql_fetch_field_row(fetch,"Ginklas2"); sscanf(fetch, "i", weps[0][2]); mysql_fetch_field_row(fetch,"Ginklas3"); sscanf(fetch, "i", weps[0][3]); mysql_fetch_field_row(fetch,"Ginklas4"); sscanf(fetch, "i", weps[0][4]); mysql_fetch_field_row(fetch,"Ginklas5"); sscanf(fetch, "i", weps[0][5]); mysql_fetch_field_row(fetch,"Ginklas6"); sscanf(fetch, "i", weps[0][6]); mysql_fetch_field_row(fetch,"Ginklas7"); sscanf(fetch, "i", weps[0][7]); mysql_fetch_field_row(fetch,"Ginklas8"); sscanf(fetch, "i", weps[0][8]); mysql_fetch_field_row(fetch,"Ginklas9"); sscanf(fetch, "i", weps[0][9]); mysql_fetch_field_row(fetch,"Ginklas10"); sscanf(fetch, "i", weps[0][10]); mysql_fetch_field_row(fetch,"Ginklas11"); sscanf(fetch, "i", weps[0][11]); mysql_fetch_field_row(fetch,"Ammo0"); sscanf(fetch, "i", weps[1][0]); mysql_fetch_field_row(fetch,"Ammo1"); sscanf(fetch, "i", weps[1][1]); mysql_fetch_field_row(fetch,"Ammo2"); sscanf(fetch, "i", weps[1][2]); mysql_fetch_field_row(fetch,"Ammo3"); sscanf(fetch, "i", weps[1][3]); mysql_fetch_field_row(fetch,"Ammo4"); sscanf(fetch, "i", weps[1][4]); mysql_fetch_field_row(fetch,"Ammo5"); sscanf(fetch, "i", weps[1][5]); mysql_fetch_field_row(fetch,"Ammo6"); sscanf(fetch, "i", weps[1][6]); mysql_fetch_field_row(fetch,"Ammo7"); sscanf(fetch, "i", weps[1][7]); mysql_fetch_field_row(fetch,"Ammo8"); sscanf(fetch, "i", weps[1][8]); mysql_fetch_field_row(fetch,"Ammo9"); sscanf(fetch, "i", weps[1][9]); mysql_fetch_field_row(fetch,"Ammo10"); sscanf(fetch, "i", weps[1][10]); mysql_fetch_field_row(fetch,"Ammo11"); sscanf(fetch, "i", weps[1][11]); GivePlayerWeapon(playerid, weps[0][0], weps[1][0]); GivePlayerWeapon(playerid, weps[0][1], weps[1][1]); GivePlayerWeapon(playerid, weps[0][2], weps[1][2]); GivePlayerWeapon(playerid, weps[0][3], weps[1][3]); GivePlayerWeapon(playerid, weps[0][4], weps[1][4]); GivePlayerWeapon(playerid, weps[0][5], weps[1][5]); GivePlayerWeapon(playerid, weps[0][6], weps[1][6]); GivePlayerWeapon(playerid, weps[0][7], weps[1][7]); GivePlayerWeapon(playerid, weps[0][8], weps[1][8]); GivePlayerWeapon(playerid, weps[0][9], weps[1][9]); GivePlayerWeapon(playerid, weps[0][10], weps[1][10]); GivePlayerWeapon(playerid, weps[0][11], weps[1][11]); GivePlayerWeapon(playerid, weps[0][1], weps[1][1]); GivePlayerWeapon(playerid, weps[0][2], weps[1][2]); GivePlayerWeapon(playerid, weps[0][3], weps[1][3]); GivePlayerWeapon(playerid, weps[0][4], weps[1][4]); GivePlayerWeapon(playerid, weps[0][5], weps[1][5]); GivePlayerWeapon(playerid, weps[0][6], weps[1][6]); GivePlayerWeapon(playerid, weps[0][7], weps[1][7]); GivePlayerWeapon(playerid, weps[0][8], weps[1][8]); GivePlayerWeapon(playerid, weps[0][9], weps[1][9]); GivePlayerWeapon(playerid, weps[0][10], weps[1][10]); GivePlayerWeapon(playerid, weps[0][11], weps[1][11]); //Booloeans LodingThing new teis; sscanf(fetch, "i", teis); if (teis) playerDB[playerid][teises] = true; mysql_fetch_field_row(fetch,"License"); // new unif; sscanf(fetch, "i", unif); if (unif) playerDB[playerid][uniformd] = true; mysql_fetch_field_row(fetch,"Uniformd"); // new cytban; sscanf(fetch, "i", cytban); if (cytban) playerDB[playerid][cytaban] = true; mysql_fetch_field_row(fetch,"CytABan"); // new mute; sscanf(fetch, "i", mute); if (mute) playerDB[playerid][muted] = true; mysql_fetch_field_row(fetch,"Mute"); // mysql_fetch_field_row(fetch,"admin"); new adminai; sscanf(fetch, "i", adminai); if(adminai) playerDB[playerid][admin]=true; // mysql_fetch_field_row(fetch,"vip"); new vipai; sscanf(fetch, "i", vipai); if(vipai) playerDB[playerid][vip]=true; // mysql_fetch_field_row(fetch,"superadmin"); new superadminai; sscanf(fetch, "i", superadminai); if(superadminai) playerDB[playerid][superadmin]=true; //Checks that prevent lots of bandwith mysql_fetch_field_row(fetch,"LastSession"); sscanf(fetch, "i", tmpa); if(gSession==tmpa) { mysql_fetch_field_row(fetch,"Car"); sscanf(fetch, "i", playerDB[playerid][pcar]); if(playerDB[playerid][pcar] != -1) { if(strcmp(pName(playerid),vehicleDB[playerDB[playerid][pcar]][owner_name],true) || !vehicleDB[playerDB[playerid][pcar]][locked]) playerDB[playerid][pcar]=-1; } mysql_fetch_field_row(fetch,"Islead"); new Islead; sscanf(fetch, "i", Islead); if(Islead) gplayerDB[playerid][islead]=true; mysql_fetch_field_row(fetch,"Gang"); sscanf(fetch, "i",gplayerDB[playerid][pgang]); }else{ playerDB[playerid][pcar]=-1; if(playerDB[playerid][biznis]!=0) if(strcmp(pName(playerid),bussinesDB[playerDB[playerid][biznis]][own_name],true)) playerDB[playerid][biznis]=0; } if(playerDB[playerid][kalejimo_laikas]>0) { SetTimerEx("UnjailPlayer",playerDB[playerid][kalejimo_laikas]*1000,0,"iffffi",playerid,-1606.0317,716.1743,12.0721,4.5951,0); playerDB[playerid][ikalintas]=true; SetTimerEx("LikoSedeti",1000,true,"i",playerid); } if(gplayerDB[playerid][pgang]!=-1 && !gangDB[gplayerDB[playerid][pgang]][isgang]) { gplayerDB[playerid][pgang]=-1; gplayerDB[playerid][islead]=false; } if(playerDB[playerid][uniformd]) SetPlayerSkin(playerid,playerDB[playerid][uniforma]); else SetPlayerSkin(playerid,playerDB[playerid][drabuziai]); print("Loadinam"); GameTextForPlayer(playerid,"~r~] Tavo zaidimas ikeltas ]",1000,5); return; }