dcmd_vbox(playerid, params[])
{
#pragma unused params
if (Vip[playerid] < 1 ) {
SendClientMessage(playerid, COLOR_CERVENA, " [!] Only Vips can do that !");
}
else {
if (Vip[playerid] >= 1) {
if (vbox[playerid] == 1) {
SendClientMessage(playerid, COLOR_CERVENA, " You can not spawn two boxes !");
}
if (vbox[playerid] == 0) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateObject(1685, x, y+2.0, z, 0.0, 0.0,0.0);
vbox[playerid] = 1;
}
}
}
return 1;
}
dcmd_vrbox(playerid, params[])
{
#pragma unused params
if (Vip[playerid] < 1 ) {
SendClientMessage(playerid, COLOR_CERVENA, " [!] Only Vips can do that !");
}
else {
if (Vip[playerid] >= 1) {
if (vbox[playerid] == 0) {
SendClientMessage(playerid, COLOR_CERVENA, "You must spawn a box first to remove it !");
}
if (vbox[playerid] == 1) {
new Float:x, Float:y, Float:z;
GetPlayerObjectPos(playerid, 1685, Float:x, Float:y, Float:z);
DestroyObject(1685);
vbox[playerid] = 0;
}
}
}
return 1;
}
new BoxObj[MAX_PLAYERS];
BoxObj[playerid] = CreateObject(1685, x, y+2.0, z, 0.0, 0.0,0.0);
DestroyObject(BoxObj[playerid]);
DestroyObject(1685);
DestroyObject(vbox[playerid]);
so i change this :
pawn Код:
pawn Код:
|
new BoxObj[MAX_PLAYERS];
dcmd_vbox(playerid, params[])
{
#pragma unused params
if (Vip[playerid] < 1 ) {
SendClientMessage(playerid, COLOR_CERVENA, " [!] Only Vips can do that !");
}
else {
if (Vip[playerid] >= 1) {
if (vbox[playerid] == 1) {
SendClientMessage(playerid, COLOR_CERVENA, " You can not spawn two boxes !");
}
if (vbox[playerid] == 0) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
DestroyObject(BoxObj[playerid]);
BoxObj[playerid] = CreateObject(1685, x, y+2.0, z, 0.0, 0.0,0.0);
vbox[playerid] = 1;
}
}
}
return 1;
}
dcmd_vrbox(playerid, params[])
{
#pragma unused params
if (Vip[playerid] < 1 ) {
SendClientMessage(playerid, COLOR_CERVENA, " [!] Only Vips can do that !");
}
else {
if (Vip[playerid] >= 1) {
if (vbox[playerid] == 0) {
SendClientMessage(playerid, COLOR_CERVENA, "You must spawn a box first to remove it !");
}
if (vbox[playerid] == 1) {
new Float:x, Float:y, Float:z;
GetPlayerObjectPos(playerid, 1685, Float:x, Float:y, Float:z);
DestroyObject(BoxObj[playerid]);
vbox[playerid] = 0;
}
}
}
return 1;
}
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;
}
thank u but 1 question : i already have new vbox so i need to add also new BoxObj ?
|
That should work perfectly, do exactly the same, don't change a thing.
pawn Код:
|