/get or /gethere
#1

Hello , I wan some help on making a simple command which just TP a player to me (Admin) I want it to be an admin command only . So please help me !
Reply
#2

pawn Код:
CMD:get( playerid, params[ ] )
{
    if( !IsPlayerAdmin( playerid ) ) return 1;
    new
        id
    ;
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "Usage: /get <ID/Part Of Name>" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Offline player" );
   
    new
        Float: xx,
        Float: yy,
        Float: zz
    ;
    GetPlayerPos( playerid, xx, yy, zz );

    if( IsPlayerInAnyVehicle( id ) ) RemovePlayerFromVehicle( id );
    SetPlayerPos( id, xx, yy, zz );
    return 1;
}
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
CMD:get( playerid, params[ ] )
{
    if( !IsPlayerAdmin( playerid ) ) return 1;
    new
        id
    ;
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "Usage: /get <ID/Part Of Name>" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Offline player" );
   
    new
        Float: xx,
        Float: yy,
        Float: zz
    ;
    GetPlayerPos( playerid, xx, yy, zz );

    if( IsPlayerInAnyVehicle( id ) ) RemovePlayerFromVehicle( id );
    SetPlayerPos( id, xx, yy, zz );
    return 1;
}
Might consider adding the interior and virtual world
pawn Код:
CMD:get( playerid, params[ ] )
{
    if( !IsPlayerAdmin( playerid ) ) return 1;
    new
        id
    ;
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "Usage: /get <ID/Part Of Name>" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Offline player" );
   
    new
        Float: xx,
        Float: yy,
        Float: zz,
            Int,
            Vir
    ;
    GetPlayerPos( playerid, xx, yy, zz );
        GetPlayerInterior(playerid, Int);
        GetPlayerVirtualWorld(playerid, Vir);
    if( IsPlayerInAnyVehicle( id ) ) RemovePlayerFromVehicle( id );
    SetPlayerPos( id, xx, yy, zz );
    SetPlayerInterior( id, Int );
    SetPlayerVirtualWorld( id, Vir);
    return 1;
}
Reply
#4

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
Might consider adding the interior and virtual world
pawn Код:
CMD:get( playerid, params[ ] )
{
    if( !IsPlayerAdmin( playerid ) ) return 1;
    new
        id
    ;
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "Usage: /get <ID/Part Of Name>" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Offline player" );
   
    new
        Float: xx,
        Float: yy,
        Float: zz,
            Int,
            Vir
    ;
    GetPlayerPos( playerid, xx, yy, zz );
        GetPlayerInterior(playerid, Int);
        GetPlayerVirtualWorld(playerid, Vir);
    if( IsPlayerInAnyVehicle( id ) ) RemovePlayerFromVehicle( id );
    SetPlayerPos( id, xx, yy, zz );
    SetPlayerInterior( id, Int );
    SetPlayerVirtualWorld( id, Vir);
    return 1;
}
Correct, I forgot it! Although, GetPlayerInterior and GetPlayerVirtualWorld return the interior/world id - they're not stored by reference.

pawn Код:
CMD:get( playerid, params[ ] )
{
    if( !IsPlayerAdmin( playerid ) ) return 1;
    new
        id
    ;
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "Usage: /get <ID/Part Of Name>" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Offline player" );
   
    new
        Float: xx,
        Float: yy,
        Float: zz
    ;
    GetPlayerPos( playerid, xx, yy, zz );

    if( IsPlayerInAnyVehicle( id ) ) RemovePlayerFromVehicle( id );
    SetPlayerInterior( id, GetPlayerInterior( playerid ) );
    SetPlayerPos( id, xx, yy, zz );
    SetPlayerVirtualWorld( id, GetPlayerVirtualWorld( playerid ) );
    return 1;
}
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Correct, I forgot it! Although, GetPlayerInterior and GetPlayerVirtualWorld return the interior/world id - they're not stored by reference.

pawn Код:
CMD:get( playerid, params[ ] )
{
    if( !IsPlayerAdmin( playerid ) ) return 1;
    new
        id
    ;
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "Usage: /get <ID/Part Of Name>" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Offline player" );
   
    new
        Float: xx,
        Float: yy,
        Float: zz
    ;
    GetPlayerPos( playerid, xx, yy, zz );

    if( IsPlayerInAnyVehicle( id ) ) RemovePlayerFromVehicle( id );
    SetPlayerInterior( id, GetPlayerInterior( playerid ) );
    SetPlayerPos( id, xx, yy, zz );
    SetPlayerVirtualWorld( id, GetPlayerVirtualWorld( playerid ) );
    return 1;
}
I got this error :

Код:
C:\Users\HP\Desktop\SA-MP Servers\New folder\BTRP\gamemodes\get command.pwn(1) : warning 203: symbol is never used: "get"
C:\Users\HP\Desktop\SA-MP Servers\New folder\BTRP\gamemodes\get command.pwn(1 -- 23) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
I want to make it in a FS .
Reply
#6

Get zcmd.inc and sscanf2.inc (plus the plugin file) and include a_samp.inc
Reply
#7

Thanks guys .
Reply
#8

Guys I added the FS but I try /get and nothing happen... Can you fix this ?
Reply
#9

If nothing happens then that means that you were not logged in as RCON as it requires.
Reply
#10

Hmm , But I dont want it for RCON only , I want from level 1 + to have the permissions to do it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)