public OnPlayerRequestClass(playerid, classid) { if(IsPlayerNPC(playerid)) return 1; TogglePlayerSpectating(playerid, 1); return 1; }
public OnPlayerConnect(playerid) { new titlestring[50]; PlayerLogged[playerid] = false; PlayAudioStreamForPlayer(playerid, "http://listen.radionomy.com/-top20-radio"); for(new i = 0; i < 100; i++) { SendClientMessage(playerid, 0x00000000," "); } if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); format(titlestring, sizeof(titlestring), "{3091DB}Bienvenue %s !", GetPlayerNameEx(playerid)); SafeDialogEx(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, titlestring, "\n{69A9D8}Bienvenue sur Real Life Rфleplay !\n\n{B7B7B7}• Version Gamemode: {FFFFFF}RLRP v"SERVER_GM_TEXT".\n{B7B7B7}• Derniиre mise а jour: {FFFFFF}08/05/2017 - 19:57 (GMT+2).\n{B7B7B7}• Modifications effectuйes:{FFFFFF}\n "MOTD_LOGIN"", "Connexion","Quitter"); } else { format(titlestring, sizeof(titlestring), "{3091DB}Inscription:"); SafeDialogEx(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, titlestring, "\n{69A9D8}Bienvenue sur Real Life Rфleplay !\n\n{B7B7B7}• Version Gamemode: {FFFFFF}RLRP v"SERVER_GM_TEXT".\n{B7B7B7}• Derniиre mise а jour: {FFFFFF}08/05/2017 - 19:57 (GMT+2).\n{B7B7B7}• Modifications effectuйes:{FFFFFF}\n "MOTD_LOGIN"", "Inscription","Quitter"); } TimerLogin[playerid] = SetTimerEx("Login", 30, 0, "d", playerid); return 1; }
public OnPlayerSpawn(playerid) { if(PlayerInfo[playerid][pInscri] == 1) return 0; { for(new i = 0; i < MAX_PLAYERS; i++) { SetPlayerMarkerForPlayer(i, playerid, 0xFFFFFF00); } SetCameraBehindPlayer(playerid); SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); return 1; } }
case DIALOG_LOGIN: { if ( !response ) return Kick ( playerid ); if( response ) { new psswrdhashed[129]; whp_hash(psswrdhashed, sizeof(psswrdhashed), inputtext); strdel(psswrdhashed, 127, 128); if(strcmp(psswrdhashed, PlayerInfo[playerid][pPass]) == 0) { PlayerLogged[playerid] = true; INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); GivePlayerMoney(playerid, PlayerInfo[playerid][pArgent]); if(PlayerInfo[playerid][pTuto] == 1) { TimerTuto[playerid] = SetTimerEx("Tuto", 500, 0, "d", playerid); SpawnPlayer(playerid); } if(PlayerInfo[playerid][pInscri] == 1) { TimerCreation[playerid] = SetTimerEx("Creation", 500, 0, "d", playerid); } return 1; } else { format(titlestring, sizeof(titlestring), "{3091DB}Erreur d'authentification!"); SafeDialogEx(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, titlestring, "\n{DD2D2D}[Erreur] {EE3A3A}Mot de passe incorrect, rйessayez.\n\n{B7B7B7}• Version Gamemode: {FFFFFF}RLRP v"SERVER_GM_TEXT".\n{B7B7B7}• Derniиre mise а jour: {FFFFFF}08/05/2017 - 19:57 (GMT+2).\n{B7B7B7}• Modifications effectuйes:{FFFFFF}\n "MOTD_LOGIN"", "Connexion","Quitter"); } } }
TogglePlayerSpectating(playerid, 0);
You can't spawn the player with SpawnPlayer if he's in spectating mode. You need to remove him from the spectating mode like this
Код:
TogglePlayerSpectating(playerid, 0); |
public Tuto(playerid) { for(new i = 0; i < 100; i++) { SendClientMessage(playerid, 0x00000000," "); } for(new i = 0; i < MAX_PLAYERS; i++) { SetPlayerMarkerForPlayer(i, playerid, 0xFFFFFF00); } SetSpawnInfo(playerid, 0, 0, 2.8513, 25.8969, 1200.0781, 0, 0, 0, 0, 0, 0, 0); StopAudioStreamForPlayer(playerid); SetPlayerPos(playerid, 2.8513, 25.8969, 1200.0781); SetPlayerVirtualWorld(playerid, 1); SetPlayerFacingAngle(playerid, 0); SetPlayerInterior(playerid, 1); SetCameraBehindPlayer(playerid); SendClientMessage(playerid, COLOR_PURPLE, "{DF9E4D}[Info] {EEDDAA}Vous commencez le tutoriel! Laissez-vous guider йtape par йtape IC."); SendClientMessage(playerid, COLOR_PURPLE, "{DF9E4D}[Info] {EEDDAA}Le tutoriel ne dыre pas longtemps, vous aurez vite l'occasion d'RP !"); TimerTuto2[playerid] = SetTimerEx("Tuto2", 10000, 0, "d", playerid); TogglePlayerControllable(playerid, 0); return 1; } public Tuto2(playerid) { PlayAudioStreamForPlayer(playerid, "https://www.englishclub.com/audio/english-for-work/airline-final-boarding.mp3"); for(new i = 0; i < 100; i++) { SendClientMessage(playerid, 0x00000000," "); } SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: Nous arrivons au niveau de la ville de San Fierro, l'avion va commencer а"); SendClientMessage(playerid, COLOR_WHITE, "baisser en altitude. Vous кtes priйs d'attacher vos ceintures, nous allons bientфt attйrrir..."); TimerTuto3[playerid] = SetTimerEx("Tuto3", 16500, 0, "d", playerid); return 1; } public Tuto3(playerid) { for(new i = 0; i < 100; i++) { SendClientMessage(playerid, 0x00000000," "); } SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: Si vous avez la tкte qui tourne, la nausйe ou une faible densitй de respiration,"); SendClientMessage(playerid, COLOR_WHITE, "les masques а oxygиnes sont disponibles juste au-dessus de vous.. Vous pouvez en placer un sur votre visage."); SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: Nous allons attйrrir d'ici 10 minutes. L'attйrrissage dыre en gйnйral quelques secondes."); SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: Une fois attйrri, vous serez dirigй vers la sortie de la piste en toute sйcuritй."); TimerTuto4[playerid] = SetTimerEx("Tuto4", 20000, 0, "d", playerid); return 1; } public Tuto4(playerid) { for(new i = 0; i < 100; i++) { SendClientMessage(playerid, 0x00000000," "); } SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: Nous commenзons а descendre de plus en plus, admirez la vue !"); SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: Nous entrons dans la ville de San Fierro dans pas moins de 2 minutes."); SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: J'espиre que le voyage vous aura plus et que vous aurez apprйciй nos services !"); TimerTuto5[playerid] = SetTimerEx("Tuto5", 17000, 0, "d", playerid); return 1; } public Tuto5(playerid) { for(new i = 0; i < 100; i++) { SendClientMessage(playerid, 0x00000000," "); } SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: Nous voilа а San Fierro, nous allons attйrrir. Prйparez-vous !"); TimerTuto6[playerid] = SetTimerEx("Tuto6", 10000, 0, "d", playerid); return 1; } public Tuto6(playerid) { for(new i = 0; i < 100; i++) { SendClientMessage(playerid, 0x00000000," "); } SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: (Bruits rйacteurs) Nous nous dirigeons vers la piste de l'aйroport de San Fierro, c'est partit"); SendClientMessage(playerid, COLOR_WHITE, "pour l'attйrrissage. Attachez vos ceintures, expirez, inspirez lentement, tout vas bien se passer."); SendClientMessage(playerid, COLOR_PURPLE, "* L'avion dйploie ses roues avant de se diriger plus bas en direction de la piste..."); TimerTuto7[playerid] = SetTimerEx("Tuto7", 17000, 0, "d", playerid); return 1; } public Tuto7(playerid) { for(new i = 0; i < 100; i++) { SendClientMessage(playerid, 0x00000000," "); } SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: (Bruits de pneus) Ehhh .. Hop! Atterrissage rйussis. Bravo а toute l'йquipe de"); SendClientMessage(playerid, COLOR_WHITE, "San Andreas Airline. Nous nous dirigeons vers l'extraction des passagers, vous serez bientфt sur le sol."); SendClientMessage(playerid, COLOR_PURPLE, "* Votre ceinture se dйcroche. Les portes d'ouvertures de l'avion s'entre-ouvre а leurs tour."); SendClientMessage(playerid, COLOR_WHITE, "(IC) Co-Pilote dit: Nous voilа arrivй! Merci d'avoir choisis notre compagnie. Veuillez rйcuperer"); SendClientMessage(playerid, COLOR_WHITE, "vos bagages et veillez а ne rien oublier. "); TogglePlayerControllable(playerid, 1); StopAudioStreamForPlayer(playerid); SetPlayerInterior(playerid, 1); SetPlayerVirtualWorld(playerid, 0); SendClientMessage(playerid, -1, " "); SendClientMessage(playerid, -1, "{EEDDAA}* Dirigez vous vers la porte de l'avion qui se trouve devant vous afin de sortir."); return 1; }
enum pinfo
{
pTuto,
InTuto
};
new PlayerInfo[MAX_PLAYERS][pinfo];
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
new psswrdhashed[129];
whp_hash(psswrdhashed, sizeof(psswrdhashed), inputtext);
strdel(psswrdhashed, 127, 128);
if(strcmp(psswrdhashed, PlayerInfo[playerid][pPass]) == 0)
{
PlayerLogged[playerid] = true;
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pArgent]);
if(PlayerInfo[playerid][pTuto] == 0)
{
TimerTuto[playerid] = SetTimerEx("Tuto", 500, 0, "d", playerid);
PlayerInfo[playerid][InTuto] = 1;
}
if(PlayerInfo[playerid][pInscri] == 1)
{
TimerCreation[playerid] = SetTimerEx("Creation", 500, 0, "d", playerid);
}
SetSpawnInfo(playerid, 0, 0, PlayerInfo[playerid][lastx], PlayerInfo[playerid][lasty], PlayerInfo[playerid][lastz], 0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
return 1;
}
else
{
format(titlestring, sizeof(titlestring), "{3091DB}Erreur d'authentification!");
SafeDialogEx(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, titlestring, "\n{DD2D2D}[Erreur] {EE3A3A}Mot de passe incorrect, rйessayez.\n\n{B7B7B7}• Version Gamemode: {FFFFFF}RLRP v"SERVER_GM_TEXT".\n{B7B7B7}• Derniиre mise а jour: {FFFFFF}08/05/2017 - 19:57 (GMT+2).\n{B7B7B7}• Modifications effectuйes:{FFFFFF}\n "MOTD_LOGIN"", "Connexion","Quitter");
}
}
}
public OnPlayerDisconnect(playerid)
{
if(PlayerInfo[playerid][InTuto] == 1)
{
PlayerInfo[playerid][InTuto] = 0;
PlayerInfo[playerid][pTuto] = 0;
}
return 1;
}
PHP код:
|