/vehcolor CMD Problem.
#4

Quote:
Originally Posted by LetsOWN[PL]
Посмотреть сообщение
Hello.
Why don't You use zcmd, which is a way more better and easier? And then Your code would look like this:
pawn Код:
COMMAND:vehcolor ( playerid, params[] ) {
    if( !IsPlayerInAnyVehicle( playerid ) ) // If player is not in vehicle, then don't do anything.
        return true;
   
    new Color[2];
    if( sscanf(params, "dd", Color[0], Color[1] ) ) {
        SendClientMessage( playerid, -1, "Usage: /vehcolor [0-255] [0-255]");
        return true;
    }
   
    if( Color[0] < 0 || Color[1] < 0 ||
        Color[0] > 255 || Color[1] > 255
    )  {
        SendClientMessage( playerid, -1, "Invalid color pair.");
        return true;
    }
   
   
    if( ChangeVehicleColor( GetPlayerVehicleID( playerid ), Color[0], Color[1] ) ) {
        new Output[64];
        format( Output, 64, "Your car color have been changed to (ID: %d) and (ID: %d)", Color[0], Color[1] );
     // Max output length for this one is 59
        SendClientMessage( playerid, -1, Output );
    } else {
        SendClientMessage( playerid, -1, "Failed to change the color. Try again." );
    }
   
    return true;
}
Greetings.
If i use this than i get the following errors.
Код:
C:\Users\Damman\Desktop\SA-MP Test\gamemodes\edrift2.pwn(24780) : error 029: invalid expression, assumed zero
C:\Users\Damman\Desktop\SA-MP Test\gamemodes\edrift2.pwn(24780) : error 017: undefined symbol "cmd_vehcolor"
C:\Users\Damman\Desktop\SA-MP Test\gamemodes\edrift2.pwn(24780) : error 029: invalid expression, assumed zero
C:\Users\Damman\Desktop\SA-MP Test\gamemodes\edrift2.pwn(24780) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply


Messages In This Thread
/vehcolor CMD Problem. - by TitanForceGeneral - 16.08.2015, 10:35
Re: /vehcolor CMD Problem. - by LetsOWN[PL] - 16.08.2015, 10:46
Re: /vehcolor CMD Problem. - by ZToPMaN - 16.08.2015, 10:57
Re: /vehcolor CMD Problem. - by TitanForceGeneral - 16.08.2015, 11:12
Re: /vehcolor CMD Problem. - by Denying - 16.08.2015, 11:13
Re: /vehcolor CMD Problem. - by MarvinPWN - 16.08.2015, 11:13
Re: /vehcolor CMD Problem. - by TitanForceGeneral - 16.08.2015, 11:15
Re: /vehcolor CMD Problem. - by MarvinPWN - 16.08.2015, 11:17
Re: /vehcolor CMD Problem. - by TitanForceGeneral - 16.08.2015, 11:23
Re: /vehcolor CMD Problem. - by Denying - 16.08.2015, 11:29

Forum Jump:


Users browsing this thread: 5 Guest(s)