/get or /gethere -
OmarT2 - 30.09.2013
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 !
Re: /get or /gethere -
Konstantinos - 30.09.2013
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;
}
Re: /get or /gethere -
DaRk_RaiN - 30.09.2013
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;
}
Re: /get or /gethere -
Konstantinos - 30.09.2013
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;
}
Re: /get or /gethere -
OmarT2 - 30.09.2013
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 .
Re: /get or /gethere -
Konstantinos - 30.09.2013
Get zcmd.inc and sscanf2.inc (plus the plugin file) and include a_samp.inc
Re: /get or /gethere -
OmarT2 - 30.09.2013
Thanks guys .
Re: /get or /gethere -
OmarT2 - 30.09.2013
Guys I added the FS but I try /get and nothing happen... Can you fix this ?
Re: /get or /gethere -
Konstantinos - 30.09.2013
If nothing happens then that means that you were not logged in as RCON as it requires.
Re: /get or /gethere -
OmarT2 - 30.09.2013
Hmm , But I dont want it for RCON only , I want from level 1 + to have the permissions to do it