monomartin
Active member
hi, I need help
I want to add a line for the player to release the weapon in case he has one, to release it when he is walking, I add one but it does not work, he does not release the weapon
#import "data/scripts/area1/automvSP.c"
void main() {
void self = getlocalvar("self");
float x = getentityvar(self, 5); //move x
float z = getentityvar(self, 6); //move z
float d = getentityvar(self, 7); //face left right
float p = getentityvar(self, 8); //player nº 0 1 2
void player = getplayerproperty(p,"entity"); // retrieve player 1 handler
if ( getentityproperty(player,"exists") ) {
changeplayerproperty(player, "weapon",0); /// <-------------------<
if ( getentityproperty(player,"noaicontrol") == 0 ) changeentityproperty(player,"noaicontrol",1);
if ( movetoxz(player,x,z,d,0.5) ) {
if ( getentityproperty(player,"noaicontrol") == 1 ) changeentityproperty(player,"noaicontrol",1);
//drawstring(110,110,0,"wait");
killentity(self); // to finish the script
}
}
}
I want to add a line for the player to release the weapon in case he has one, to release it when he is walking, I add one but it does not work, he does not release the weapon
#import "data/scripts/area1/automvSP.c"
void main() {
void self = getlocalvar("self");
float x = getentityvar(self, 5); //move x
float z = getentityvar(self, 6); //move z
float d = getentityvar(self, 7); //face left right
float p = getentityvar(self, 8); //player nº 0 1 2
void player = getplayerproperty(p,"entity"); // retrieve player 1 handler
if ( getentityproperty(player,"exists") ) {
changeplayerproperty(player, "weapon",0); /// <-------------------<
if ( getentityproperty(player,"noaicontrol") == 0 ) changeentityproperty(player,"noaicontrol",1);
if ( movetoxz(player,x,z,d,0.5) ) {
if ( getentityproperty(player,"noaicontrol") == 1 ) changeentityproperty(player,"noaicontrol",1);
//drawstring(110,110,0,"wait");
killentity(self); // to finish the script
}
}
}