30.09.2013, 15:54
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 !
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;
}
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;
}
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
;
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;
}
Correct, I forgot it! Although, GetPlayerInterior and GetPlayerVirtualWorld return the interior/world id - they're not stored by reference.
pawn Код:
|
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.