08.07.2011, 08:42
Well can someone help me ,how to make private vehicle with password and dialog?we fill the password in the dialog
new
passwordedVeh,
vehPassword[ 64 ] = "omgwtfbbq"
;
public OnGameModeInit( )
{
passwordedVeh = AddStaticVehicle( 411, 0.0, 0.0, 0.0, 0.0, -1, -1 );
return 1;
}
public OnPlayerEnterVehicle( playerid, vehicleid )
{
if ( vehicleid == passwordedVeh )
{
ShowPlayerDialog( playerid, 777, DIALOG_STYLE_INPUT, "Error", "This vehicle is passworded, enter the password!", "Use Vehicle", "Exit" );
TogglePlayerControllable( playerid, false );
}
return 1;
}
public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
if ( dialogid == 777 )
{
if ( !strcmp( inputtext, vehPassword, false ) ) {
TogglePlayerControllable( playerid, true );
// success! u have entered the correct password
}
else {
RemovePlayerFromVehicle( playerid );
TogglePlayerControllable( playerid, true );
// ERROR: u've entered a wrong password, kthxbai.
}
}
return 1;
}
D:\Test server\filterscripts\Valo_Car.pwn(238) : error 017: undefined symbol "vehpassword"
D:\Test server\filterscripts\Valo_Car.pwn(238) : error 017: undefined symbol "vehpassword"
public OnStateChange( playerid, newstate, oldstate )
{
if ( newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == passwordedVeh )
{
ShowPlayerDialog( playerid, 777, DIALOG_STYLE_INPUT, "Error", "This vehicle is passworded, enter the password!", "Use Vehicle", "Exit" );
TogglePlayerControllable( playerid, false );
}
return 1;
}