Little Help!
#1

Hey Guys!

Can anyone tell me how do i make an /Car (VehID) (CC1) (CC2) Command??

And i need an cmd to disable and enable chat.

Thanks.
Reply
#2

Use dcmd and sscanf.

The disabling chat is easy.
create a variable:
Код:
new ChatDisabled = 0;
Then create a command, inside that command assign the ChatDisabled var to 1:
pawn Код:
dcmd_disablechat(playerid,params[])
{
    if(ChatDisabled == 0)
    {
        ChatDisabled = 1;
    }
    else
    {
        ChatDisabled = 0;    
    }
    return 1;
}
then under OnPlayerText put:
pawn Код:
if(ChatDisabled == 1) return 0;
That's a simple command for turning off and on chat.
Reply
#3

Here's the /car [Model] [CC1] [CC2] command in ZCMD + sscanf2 - Credits to Zeex and ****** for those.
pawn Код:
CMD:car( playerid, params[] )
{
    /*if ( GetAdminLevel( playerid ) < 5 ) // This is for your admin variable
        return 1;*/


    new tempveh1, tempcol1, tempcol2;
    if ( sscanf( params, "iii", tempveh1, tempcol1, tempcol2 ) )
        return SendClientMessage( playerid, -1, "Usage: /veh <CarID> [Color 1] [Color 2]");

    if ( !IsValidVeh( tempveh1 ) )
        return SendClientMessage( playerid, -1, "VEHICLE: Invalid vehicle ID.");

        new Float:pos[ 3 ],Float:a;
        GetPlayerPos( playerid, pos[ 0 ], pos[ 1 ], pos[ 2 ] );
        GetPlayerFacingAngle( playerid, a );
       
        new tempveh;
        tempveh = CreateVehicle( tempveh1, pos[ 0 ], pos[ 1 ], pos[ 2 ], a, tempcol1, tempcol2, -1 );
        PutPlayerInVehicle( playerid, tempveh, 0 );
        return 1;
}
And the IsValidVeh stock:
pawn Код:
stock IsValidVeh(VehicleID)
{
    if( ( VehicleID >= 400 && VehicleID <= 611 ) ) return true;
    return false;
}
Reply
#4

Thank you both it worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)