Comanda
CMD:spawnchange( playerid, params )
{
ShowPlayerDialog( playerid, DIALOG_SPAWNCHANGE, DIALOG_STYLE_LIST, "Spawn Change:", "HQ/Spawn\nCasa\nApartament", "Set", "Cancel" );
return true;
}
Dialog-ul
case DIALOG_SPAWNCHANGE:
{
if( !response ) return true;
switch(listitem)
{
case 0:
{
PlayerInfo[ playerid ][ pSpawnChange ] = 0;
}
case 1:
{
if( PlayerInfo[ playerid ][ pPhousekey ] == 999 ) return SCM( playerid, -1, "Nu ai o casa." );
PlayerInfo[ playerid ][ pSpawnChange ] = 1;
}
case 2:
{
have_apartment( playerid ) == -1 ) return SCM( playerid, -1, "Nu ai un apartament." );
PlayerInfo[ playerid ][ pSpawnChange ] = 2;
}
}
Update( playerid, pSpawnChangex );
SCM( playerid, COLOR_YELLOW, "Ai schimbat spawnul cu succes." );
}
De adaugat la OnPlayerSpawn
switch( PlayerInfo[ playerid ][ pSpawnChange ] )
{
case 0:
{
SetPlayerInterior( playerid, 0 );
SetPlayerVirtualWorld( playerid, 0 );
SetPlayerPos( playerid, x, y, z ); // pozitie spawn default
}
case 1:
{
SetPlayerInterior( playerid, interiorCasa );
SetPlayerVirtualWorld( playerid, vwCasa );
SetPlayerPos( playerid, x, y, z ); // pozitie spawn casa
}
case 2:
{
SetPlayerInterior( playerid, interiorApartament );
SetPlayerVirtualWorld( playerid, vwApartament );
SetPlayerPos( playerid, x, y, z ); // pozitie spawn apartament
}
}
Sper ca ai inteles ce ai de facut.