2 in 1 commands
#5

Quote:
Originally Posted by FalconX
Посмотреть сообщение
pawn Код:
new bool:bIsGoEnabled[ MAX_PLAYERS ]; // top


CMD:go( playerid, params[ ] )
{
    if( isnull( params ) )
    {
        if( bIsGoEnabled[ playerid ] )
        {
            bIsGoEnabled[ playerid ] = false;
            SendClientMessage( playerid, -1, "GO: Disabled" );
        }
        else
        {
            bIsGoEnabled[ playerid ] = true;
            SendClientMessage( playerid, -1, "GO: Enabled" );
        }
    }
    else
    {
        new goid;
        if( sscanf( params, "u", goid ) ) return SendClientMessage( playerid, -1, "Error: /go <id>" );
        if( IsPlayerConnected( goid ) || goid == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Error: Player not connected or invalid id" );
       
        if( !bIsGoEnabled[ playerid ] ) return SendClientMessage( playerid, -1, "Error: GO is disabled." );
       
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos( goid, X, Y, Z );
        SetPlayerPos( playerid, X, Y, Z );
       
        SendClientMessage( playerid, -1, "GO: You have been teleported." );
    }
    return 1;
}
Not sure if this is what you want, just made it as soon as I could - Try and see I am unsure if it has bugs or something..

Hope this helps.
Regards,
FalconX
Nothings change bro nothing happens. Can you make it simple script? If

/go - sendclientmessage /go <id>
/gof - Disable goes.

also add if player is not online - Player not connected or invalid id
Reply


Messages In This Thread
2 in 1 commands - by kbalor - 25.06.2012, 18:25
Re: 2 in 1 commands - by dowster - 25.06.2012, 18:51
Re: 2 in 1 commands - by kbalor - 25.06.2012, 18:56
Re: 2 in 1 commands - by FalconX - 25.06.2012, 19:01
Re: 2 in 1 commands - by kbalor - 25.06.2012, 19:24
Re: 2 in 1 commands - by FalconX - 13.07.2012, 07:41

Forum Jump:


Users browsing this thread: 1 Guest(s)