24.02.2011, 19:50
Quote:
LOL ... ok i haven't any errors/warnings but it still don't work xppp
In-game: if i type the cmd (just /get) it says: 'You have teleported Michael@Belgium to your location" "You have been teleproted to adminstrator Michael@Belgium's positions" When i type /get 0; 'You have teleported Michael@Belgium to your location" "You have been teleproted to adminstrator Michael@Belgium's positions" When i type /get 1 'You have teleported Michael@Belgium to your location" "You have been teleproted to adminstrator Michael@Belgium's positions" So when i start with /get it always says: 'You have teleported Michael@Belgium to your location" "You have been teleproted to adminstrator Michael@Belgium's positions" ;o |
pawn Code:
if( !strcmp( cmdtext, "/get", cmdtext, true, 4 ) )
{
if( !IsPlayerAdmin( playerid ) )
return 0;
new Index;
tmp = strtok( cmdtext, Index );
new giveplayerid = strval( tmp );
if( !IsPlayerConnected( giveplayerid ) )
return SendClientMessage( playerid, 0xAAAAAA, "Player not connected" );
if( !strlen( tmp ) )
return SendClientMessage( playerid, 0xAAAAAA, "USAGE: /get [ID]");
if (giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xAAAAAAA, "That player ID is not available.");
if (playerid == giveplayerid) return SendClientMessage(playerid, 0xAAAAAA, "You cannot teleport to yourself");
new Float:x, Float:y, Float:z;
GetPlayerPos( playerid, x, y, z );
SetPlayerPos( giveplayerid, x, y, z );
new string[ 128 ];
new pName[ 24 ], aName[ 24 ];
GetPlayerName( playerid, aName, 24 );
GetPlayerName( giveplayerid, pName, 24 );
format( string, sizeof string, "You have teleported %s to your location", pName );
SendClientMessage( playerid, 0xAAAAAA, string );
format( string, sizeof string, "You have been teleported to administrator %s's position", aName );
return SendClientMessage( giveplayerid, 0xAAAAAA, string );
}