04.12.2011, 09:49
Hey.. a few days ago I asked for help about the spawn of player after he write his password on the login dialog and someone told me to use SetSpawnInfo
and.. right now I created the first faction.. and when player logs even if he's leader / member of faction 1 he wont spawn at the place I tell him.. and he spawns with CJ skin and on the same place like someone who's not member /leader
Any ideas? and I check the player user file and its saying that he's leader 1
and.. right now I created the first faction.. and when player logs even if he's leader / member of faction 1 he wont spawn at the place I tell him.. and he spawns with CJ skin and on the same place like someone who's not member /leader
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Level",1);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Helper",0);
INI_WriteInt(File,"Sex",0);
INI_WriteInt(File,"Age",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Tutorial",0);
INI_WriteInt(File,"Leader",0);
INI_WriteInt(File,"Member",0);
INI_WriteInt(File,"Model",0);
INI_WriteInt(File,"Char",0);
INI_Close(File);
SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
SpawnPlayer(playerid);
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
new string[256];
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string, sizeof(string), "SERVER: Welcome %s",playername2);
SendClientMessage(playerid, COLOR_LIGHTBLUE,string);
SetSpawnInfo( playerid, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0 );
SpawnPlayer(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
}
}
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
GangZoneShowForPlayer(playerid, lesangre, 0x8000004C);
GangZoneShowForPlayer(playerid, Cripz, 0x0000FF52);
GangZoneShowForPlayer(playerid, Vatos, 0x00FF0052);
GangZoneShowForPlayer(playerid, Bloodz, 0xFF000052);
SetPlayerHealth(playerid, 100.0);
if(PlayerInfo[playerid][pTut] == 0)
{
SetCameraBehindPlayer(playerid);
SetPlayerPos(playerid, 1.8399,23.1198,1199.5938);
SetPlayerCameraPos(playerid, 0.4909, 23.9985, 1200.8705);
SetPlayerCameraLookAt(playerid, 1.3800, 23.5440, 1200.2909);
SetPlayerInterior(playerid, 1);
TogglePlayerControllable(playerid, 0);
TutStep[playerid] = 1;
SendClientMessage(playerid, COLOR_TUT, "Civilized Gangstaz - Role Play Tutorial");
SendClientMessage(playerid, COLOR_LIGHTRED, "Please read all the tutorial and the rules!");
SendClientMessage(playerid, COLOR_TUT, "What is your gender? (male / female).");
return 1;
}
if(PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pLeader] == 0)
{
SetPlayerPos(playerid,-1968.6703,111.2292,27.6875);
SetCameraBehindPlayer(playerid);
SetPlayerFacingAngle(playerid, 4.0930);
SetPlayerInterior(playerid, 0);
return 1;
}
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid, 242.5966,66.2802,1003.6406);
return 1;
}
return 1;
}