11.02.2012, 18:29
Facil
comesso gm
dialog
ainda em dialog
agora pra terminar
no login
no set player spawn
e so, ajudei da um + na reputaзгo ae
comesso gm
pawn Код:
enum pInfo
{
pCity,
};
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
if(dialogid == 9)
{
if(response == 0)
{
PlayerInfo[playerid][pSex] = 2;
SetPlayerSkin(playerid, 12);
PlayerInfo[playerid][pSkin] = 12;
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
RegistrationStep[playerid] = 0;
ShowPlayerDialog(playerid,1232,0,"Escolha sua Cidade","-Vocк Escolheu seu Sexo\n-Agora escolha sua Cidade\n\n-Clique em Los Santos ou San Fierro","Los Santos","San Fierro");
return 1;
}
if(response == 1)
{
PlayerInfo[playerid][pSex] = 1;
SetPlayerSkin(playerid, 23);
PlayerInfo[playerid][pSkin] = 23;
SendClientMessage(playerid, TEAM_VAGOS_COLOR, "Certo, Vocк й um Homem!.");
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
RegistrationStep[playerid] = 0;
ShowPlayerDialog(playerid,1232,0,"Escolha sua Cidade","-Vocк Escolheu seu Sexo\n-Agora escolha sua Cidade\n\n-Clique em Los Santos ou San Fierro","Los Santos","San Fierro");
return 1;
}
return 1;
}
pawn Код:
if(dialogid == 1232)
{
if(response == 0)
{
PlayerInfo[playerid][pCity] = 2;
return 1;
}
if(response == 1)
{
PlayerInfo[playerid][pCity] = 1;
return 1;
}
return 1;
}
pawn Код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "Players/%s.ini", playername3);
new File: hFile = fopen(string3, io_write);
if (hFile)
{
format(var, 32, "minhacity=%d\n",PlayerInfo[playerid][pCity]);fwrite(hFile, var);
fclose(hFile);
}
}
return 1;
}
pawn Код:
public OnPlayerLogin(playerid,password[])
{
new tmp2[256];
new string2[64];
format(string2, sizeof(string2), "Players/%s.ini", PlayerName(playerid));
strmid(PlayerInfo[playerid][pKey], dini_Get(string2, "Key"), 0, strlen(dini_Get(string2, "Key")), 255);
new File: UserFile = fopen(string2, io_read);
if (UserFile)
{
if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0)
{
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while (fread(UserFile, Data, sizeof(Data)))
{
if( strcmp( key , "minhacity" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCity] = strval( val ); }
}//end while
fclose(UserFile);//close the file after everything has been read in the while
}
}
return 1;
}
pawn Код:
public SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(PlayerInfo[playerid][pCity] == 1)
{
SetPlayerPos(playerid,1243.2660,-1693.4352,16.1977);
SetPlayerFacingAngle(playerid, 186.2567);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(PlayerInfo[playerid][pCity] == 2)
{
SetPlayerPos(playerid,-2228.0908,251.9710,35.3203);
SetPlayerFacingAngle(playerid, 47.1624);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
}
return 1;
}