/messageon and /messageoff
#2

Simple, you need FOREACH include, just search in ******, don't be lazy okay?

pawn Код:
// A simple replace for your command ( messageon and messageoff )
if ( !strcmp( cmdtext, "/messages", true ) )
{
    SetPVarInt( playerid, "SendJumpMessage", ( GetPVarInt( playerid, "SendJumpMessage" ) == 1 ) ? 0 : 1 );

    switch ( GetPVarInt( playerid, "SendJumpMessage" ) )
    {
        case 0 : SendClientMessage( playerid, COLOR_YELLOW, "Jump messages are now on." );
        case 1 : SendClientMessage( playerid, COLOR_YELLOW, "Jump messages are now off." );
    }

    return 1;
}

// Example teleport cmd

if ( !strcmp( cmdtext, "/middleOfSA", true ) )
{
    SetPlayerPos( playerid, 0.0, 0.0, 0.0 + 3.0 );

    foreach (Player, i)
    {
        if ( GetPVarInt( i, "SendJumpMessage" ) == 0 )
        {
            new
                string[ 128 ], name[ 24 ]
            ;

            GetPlayerName( playerid, name, sizeof ( name ) );
   
            format( string, sizeof ( string ), "* [ID: %d] %s has teleported to /middleOfSA", playerid, name );

            SendClientMessage( i, COLOR_WHITE, string );
        }
    }

    return 1;
}

// Sorry for crappy indentation
Reply


Messages In This Thread
/messageon and /messageoff - by ]B4E[kengston - 08.07.2011, 11:32
Re: /messageon and /messageoff - by Basicz - 08.07.2011, 11:46
Re: /messageon and /messageoff - by ]B4E[kengston - 08.07.2011, 11:52
Re: /messageon and /messageoff - by Basicz - 08.07.2011, 12:06
Re: /messageon and /messageoff - by Rolyy - 08.07.2011, 14:44

Forum Jump:


Users browsing this thread: 1 Guest(s)