28.02.2013, 16:47
Hey guys, I have some problem. I want, that a newcomer who connects, should after registering be able to select any skin and spawn.. + get 4000$. When he disconnects it should be saved the skin ...
now my problem is, that the newcomer doesnt get 4k$ and spawns always as cj and cant select any skin...even after saving he spawns by a 2nd connect as cj
OnGameModInit
now my problem is, that the newcomer doesnt get 4k$ and spawns always as cj and cant select any skin...even after saving he spawns by a 2nd connect as cj
OnGameModInit
Код:
//------------------------[PLAYER CLASS SELECTION]-------------------------- AddPlayerClass(1,1728.8132,-1111.8784,24.0859,179.3718,0,0,0,0,0,0); AddPlayerClass(6,1728.8132,-1111.8784,24.0859,179.3718,0,0,0,0,0,0); AddPlayerClass(7,1728.8132,-1111.8784,24.0859,179.3718,0,0,0,0,0,0); AddPlayerClass(22,1728.8132,-1111.8784,24.0859,179.3718,0,0,0,0,0,0); AddPlayerClass(39,1728.8132,-1111.8784,24.0859,179.3718,0,0,0,0,0,0); AddPlayerClass(101,1728.8132,-1111.8784,24.0859,179.3718,0,0,0,0,0,0); AddPlayerClass(135,1728.8132,-1111.8784,24.0859,179.3718,0,0,0,0,0,0); AddPlayerClass(4,1728.8132,-1111.8784,24.0859,179.3718,0,0,0,0,0,0); AddPlayerClass(5,1728.8132,-1111.8784,24.0859,179.3718,38,600,0,0,0,0);
Код:
public OnPlayerRequestClass(playerid, classid) { new Spielerdatei[64]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name); //s steht fьr string fьr spielername if(dini_Exists(Spielerdatei)) { SetPlayerSkin(playerid,dini_Int(Spielerdatei,"PSkin")); SetPlayerPos(playerid,1728.8132,-1111.8784,24.0859); } else { SetPlayerPos(playerid,2106.5654,1788.9365,10.6719); SetPlayerFacingAngle(playerid,245.1837); SetPlayerCameraPos(playerid,2111.6599,1786.5791,10.6719); SetPlayerCameraLookAt(playerid,2106.5654,1788.9365,10.6719); } return 1; }
Код:
public OnPlayerConnect(playerid) { new Spielerdatei[64]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name); //s steht fьr string fьr spielername if(dini_Exists(Spielerdatei)) { ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Account has been found. Please enter your password.","Login","Cancel"); } else { ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registering","Choose a password:","Register!","Cancel"); new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"%s has joined the server. Welcome!",pName); SendClientMessageToAll(0xFEFEFEFF,string); } return 1; }
Код:
public OnPlayerDisconnect(playerid, reason) { if(GetPVarInt(playerid,"loggedin")==1) { SpielerSpeichern(playerid);//Spieler Speichern } return 1; }
Код:
public OnPlayerSpawn(playerid) { new Spielerdatei[64]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name); //s steht fьr string fьr spielername if(dini_Exists(Spielerdatei)) { SendClientMessage(playerid,green,"Your data has been successfully loaded."); SetPlayerPos(playerid,1728.8132,-1111.8784,24.0859); } else { GivePlayerMoney(playerid,4000); } return 1; }