Player state?

Started by =RK=MarineForce, Sep 12, 2018, 12:35 PM

Previous topic - Next topic

=RK=MarineForce

else if ( cmd == "state" )
{
if(!text) MessagePlayer("[#FF0000] Syntax /state <Nick> ",player);
local plr = FindPlayer(text);
if(!plr) MessagePlayer("[#FF0000] Error- " + text + " is not online ",player);
else if ( !plr.IsSpawned ) MessagePlayer( "[#FF0000]The Player hasn't spawned yet..", player );
else{
if( plr.State == 1 ) MessagePlayer("[#CCFF00] " + plr.Name + " state: OnFoot " + plr.State + " ",player);
if( plr.State == 2 ) MessagePlayer("[#CCFF00] " + plr.Name + " state: OnFire " + plr.State + " ",player);
if( plr.State == 3 ) MessagePlayer("[#CCFF00] " + plr.Name + " state: Driver " + plr.State + " ",player);
if( plr.State == 4 ) MessagePlayer("[#CCFF00] " + plr.Name + " state: Passenger " + plr.State + "  ",player);
if( plr.State == 5 ) MessagePlayer("[#CCFF00] " + plr.Name + " state: Enter Vehicle " + plr.State + "  ",player);
if( plr.State == 6 ) MessagePlayer("[#CCFF00] " + plr.Name + " state: Enter Passenger " + plr.State + "  ",player);
if( plr.State == 7 ) MessagePlayer("[#CCFF00] " + plr.Name + " state: Exit Vehicle " + plr.State + " ",player);
}
}

Hmmm. its help.

Pun1sh3r

#1
Your Player States are wrong, atleast 2. It should be "Player State: Aim" not "Player State: OnFire"

I have found this in Stormeus Squirrel Plugin in file VCMP.h can be found here: https://bitbucket.org/stormeus/0.4-squirrel/src/3303346a7f41f99bb33e7bd3d840a7155d8bcf86/VCMP.h?at=master&fileviewer=file-view-default

Quotetypedef enum {
   vcmpPlayerStateNone = 0,
   vcmpPlayerStateNormal = 1,
   vcmpPlayerStateAim = 2,
   vcmpPlayerStateDriver = 3,
   vcmpPlayerStatePassenger = 4,
   vcmpPlayerStateEnterDriver = 5,
   vcmpPlayerStateEnterPassenger = 6,
   vcmpPlayerStateExit = 7,
   vcmpPlayerStateUnspawned = 8,
   forceSizeVcmpPlayerState = INT32_MAX
} vcmpPlayerState;

I have updated the Player state in VC:MP Wiki months ago, can be checked here:
http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Player.State

=RK=MarineForce

nice bro i think there are many snippest which are not updated in wiki?.