Hi,
I want to remove Cash when a vehicle is spawned. I use the follow script :
else if ( szCmd == "spawncar" )
{
if ( szParams )
{
local pTemp = split( szParams, " " ), ID = 90;
if ( IsNum( pTemp[ 0 ] ) ) ID = pTemp[ 0 ].tointeger();
if ( pPlayer.Cash >= 250 )
{
if ( ( ID >= 90 ) && ( ID <= 150 ) )
{
local v = pPlayer.Pos;
pPlayer.Cash -= 250;
MessagePlayer( "Der Mechaniker hat dir das Auto " + ID + " geliefert", pPlayer );
CreateVehicle( ID, Vector( v.x + 5, v.y, v.z ), pPlayer.Angle );
}
}
else
{
MessagePlayer ( "Du brauchst mindestens $250 um ein Auto zu Spawnen", pPlayer );
}
}
}
But my server still crash, with no reason!
If I remove these command "pPlayer.Cash -= 250 ;" it's still working!
But why this won't work ? "pPlayer.Cash >= 250" will work also.
Thanks, greetings Annoxoli