29.10.2012, 16:25
Hello Guys,
I was thinking that there is a Useful Functions and Useful Snippets topic so why not create a Useful Commands topic.
Then i saw a thread where a guy asked if there was a Useful Commands topic.
I got permission to create this thread from ****** so here it is.
Heres a simple /goto and /bring command required in many servers.
I was thinking that there is a Useful Functions and Useful Snippets topic so why not create a Useful Commands topic.
Then i saw a thread where a guy asked if there was a Useful Commands topic.
I got permission to create this thread from ****** so here it is.
Heres a simple /goto and /bring command required in many servers.
pawn Код:
if ( strcmp( cmd, "/goto", true ) == 0 )
{
new tmp[256];
tmp = strtok( cmdtext, idx );
if ( !strlen( tmp ) ) { return 1; }
new Float:X, Float:Y, Float:Z;
if ( GetPlayerVehicleID( playerid ) )
{
GetPlayerPos( strval(tmp), X, Y, Z );
SetVehiclePos( GetPlayerVehicleID(playerid), X+2, Y+2, Z );
} else {
GetPlayerPos( strval(tmp), X, Y, Z );
SetPlayerPos( playerid, X+2, Y+2, Z );
}
return 1;
}
if ( strcmp( cmd, "/bring", true ) == 0 )
{
new tmp[256];
tmp = strtok( cmdtext, idx );
if ( !strlen( tmp ) ) { return 1; }
new Float:X, Float:Y, Float:Z;
if ( GetPlayerVehicleID( strval(tmp) ) )
{
GetPlayerPos( playerid, X, Y, Z );
SetVehiclePos( GetPlayerVehicleID(strval(tmp)), X+2, Y+2, Z );
} else {
GetPlayerPos( playerid, X, Y, Z );
SetPlayerPos( strval(tmp), X+2, Y+2, Z );
}
return 1;
}