SA-MP Forums Archive
convert this to zcmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: convert this to zcmd (/showthread.php?tid=473210)



convert this to zcmd - kbalor - 01.11.2013

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;
}



Re: convert this to zcmd - Chasm - 01.11.2013

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.


Re: convert this to zcmd - kbalor - 01.11.2013

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;
}



Re: convert this to zcmd - Patrick - 01.11.2013

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;
}



Re: convert this to zcmd - Chasm - 01.11.2013

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