public OnPlayerConnect(playerid) { if(pInfo[playerid][AutoLogin] == 1) { SetSpawnInfo( playerid, 0, 0, whatever, whatever, whatever, 0, 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); } }
SetCameraBehindPlayer(playerid);
Use
pawn Код:
|
public OnPlayerConnect(playerid) { if(!fexist(Jfile)) { format(Jstring, sizeof(Jstring),"Nick name \"%s\" isn't registered\nEnter the password:", JGetName(playerid)); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Register an account!", Jstring, "Register", "Kick"); } else { pInfo[playerid][Registered] = 1; format(Jfile, 100, ACCOUNTS_PATH, JGetName(playerid)); INI_ParseFile(Jfile, "GetPlayerInfo", .bExtra = true, .extra = playerid); if(pStat[playerid][pAutoLogin] == 1 && (!strcmp(pIP, pInfo[playerid][IP],true))) { format(Jfile, 100, ACCOUNTS_PATH, JGetName(playerid)); INI_ParseFile(Jfile, "LoginPlayer", .bExtra = true, .extra = playerid); SendClientMessage(playerid,orange,"You have been automatically logged In, Type /Autologin to disable it."); pInfo[playerid][Logged] = 1; //SetCameraBehindPlayer(playerid); Tried before and didn't work //TogglePlayerSpectating(playerid, 0); ^^ SetSpawnInfo( playerid, 0, 0, PosX[playerid], PosY[playerid], PosZ[playerid], Angle[playerid], 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); } }
Use your code in OnPlayerRequestClass instead, in OnPlayerConnect will not work.
|
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { switch(GetPlayerVehicleID(playerid)) { case 523, 427, 490, 528, 596, 598, 597, 599, 432, 601: //Police Cars.. { SendClientMessage(playerid, blue, "You entered a police car"); } } } if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) { switch(GetPlayerVehicleID(playerid)) { case 523, 427, 490, 528, 596, 598, 597, 599, 432, 601: //Police Cars.. { SendClientMessage(playerid, blue, "You exited a police car"); } } } } CMD:start(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if( vehicleid == 596 ) { SendClientMessage(playerid, blue, "You started..."); } else return SendClientMessage(playerid, blue, "You're not in a police car..."); }