15.03.2010, 17:13
мобыть такое?
Code:
stock playerObjID [ MAX_PLAYERS ] = { INVALID_OBJECT_ID, ... };
forward destroyPlayerObj ( playerid );
public destroyPlayerObj ( playerid )
{
DestroyObject( playerObjID[playerid] );
playerObjID[playerid] = INVALID_OBJECT_ID;
}
public OnPlayerCommandText ( playerid, cmdtext[] )
{
if ( strcmp( cmdtext, "/komanda", true ) == 0 )
{
if ( playerObjID[playerid] == INVALID_OBJECT_ID )
{
playerObjID[playerid] = CreateObject( 980, 0.0, 0.0, 0.0, 0.0, 0.0, 360.0 );
AttachObjectToPlayer( playerObjID[playerid], playerid, 0.5, 0.0, 1.5, 90.0, 90.0, 2.0 );
SetTimerEx( "destroyPlayerObj", 1000, 0, "d", playerid );
}
else
SendClientMessage( playerid, 0x777777AA, " Объект уже создан." );
return 1;
}
return 0;
}

