convert this to zcmd
#1

Hi I tried to convert it to zcmd but I failed. Can you please convert it to zcmd? Thanks!


Код:
public OnPlayerCommandText( playerid, cmdtext[] )
{
	if ( strcmp( cmdtext, "/vdialog", true, 8 ) == 0 )
	{
	    if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
	    {
			#if !defined IGNORE_VEHICLE_ACTIVATION
	    		ShowPlayerDefaultDialog( playerid );
	    		return 1;
			#endif
		}

		if ( GetPlayerState( playerid ) != PLAYER_STATE_PASSENGER ) ShowPlayerDefaultDialog( playerid );
	    return 1;
	}
	return 0;
}
Reply
#2

pawn Код:
CMD:vdialog(playerid, params[])
{
    {
        if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
        {
            #if !defined IGNORE_VEHICLE_ACTIVATION
            ShowPlayerDefaultDialog( playerid );
            return 1;
            #endif
        }
        if ( GetPlayerState( playerid ) != PLAYER_STATE_PASSENGER ) ShowPlayerDefaultDialog( playerid );
        return 1;
    }
    return 0;
}
This should work.
Reply
#3

Quote:
Originally Posted by Chasm
Посмотреть сообщение
pawn Код:
CMD:vdialog(playerid, params[])
{
    {
        if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
        {
            #if !defined IGNORE_VEHICLE_ACTIVATION
            ShowPlayerDefaultDialog( playerid );
            return 1;
            #endif
        }
        if ( GetPlayerState( playerid ) != PLAYER_STATE_PASSENGER ) ShowPlayerDefaultDialog( playerid );
        return 1;
    }
    return 0;
}
This should work.
Got this warning.
Код:
(85) : warning 225: unreachable code
line

Код:
    return 0;
EDIT: Got it now..

Код:
CMD:v(playerid, params[])
{
        if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
        {
            #if !defined IGNORE_VEHICLE_ACTIVATION
            ShowPlayerDefaultDialog( playerid );
            return 1;
            #endif
        }
        if ( GetPlayerState( playerid ) != PLAYER_STATE_PASSENGER ) ShowPlayerDefaultDialog( playerid );
        return 1;
}
Reply
#4

pawn Код:
CMD:vdialog(playerid, params[])
{
    if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
    {
        #if !defined IGNORE_VEHICLE_ACTIVATION
        ShowPlayerDefaultDialog( playerid );
        return 1;
        #endif
    }
    if ( GetPlayerState( playerid ) != PLAYER_STATE_PASSENGER ) ShowPlayerDefaultDialog( playerid );
    return 1;
}
Reply
#5

Remove ''return 0;''. I didn't touch your code, you wrote it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)