Quote:
Originally Posted by ServerScripter
thank u but 1 question : i already have new vbox so i need to add also new BoxObj ?
|
Quote:
Originally Posted by Toreno
That should work perfectly, do exactly the same, don't change a thing.
pawn Код:
new BoxObject[ MAX_PLAYERS ], BoxVariable[ MAX_PLAYERS ] ;
dcmd_vbox( playerid, params[] ) { #pragma unused params
if( Vip[ playerid ] < 1 ) return SendClientMessage( playerid, COLOR_CERVENA, " [!] Only Vips can do that !" );
if( BoxVariable[ playerid ] ) return SendClientMessage( playerid, COLOR_CERVENA, " You can not spawn two boxes !" ); new Float:x, Float:y, Float:z ; GetPlayerPos( playerid, x, y, z ); BoxObject[ playerid ] = CreateObject( 1685, x, y+2.0, z, 0.0, 0.0, 0.0 ); BoxVariable[playerid] = 1; return 1; }
dcmd_vrbox( playerid, params[] ) { #pragma unused params if( Vip[ playerid ] < 1 ) return SendClientMessage( playerid, COLOR_CERVENA, " [!] Only Vips can do that !" ); if( !BoxVariable[ playerid ] ) return SendClientMessage( playerid, COLOR_CERVENA, "You must spawn a box first to remove it !" ); DestroyObject(BoxObject[ playerid ]);
BoxVariable[playerid] = 0;
return 1; }
|
DO THIS.
The two variables are supposed to be at top of your script.