Problems with ID 13
#1

First off heres the code:


http://pastebin.com/m79eea017



Problem: I modded this to respawn the car the player spawned before when they spawn a new one, Works like a charm but for some reason only happens to id 13 when they spawn a car it disappears like 10 secs later and ejects them? and its just ID 13

Any of you guys know how to fix it
Reply
#2

It makes no sense for it to only effect ID 13.

I'd also like to note that there are quite a few non necessities in that script.
Reply
#3

like?
Reply
#4

Nothing huge, multiple creations of the same variable could be reduced by making global temporary variables.

Example:
This
pawn Код:
new Float:gFloatTemp[4]; //commonly used in coordinates (x,y,z,a)
public OnPlayerUpdate(playerid)
{
  GetPlayerPos(playerid,gFloatTemp[0],gFloatTemp[1],gFloatTemp[2]);
  GetPlayerFacingAngle(playerid,gFloatTemp[3]);
}
Is Faster Than This


pawn Код:
public OnPlayerUpdate(playerid)
{
  new Float:x,Float:y,Float:z,Float:a;
  GetPlayerPos(playerid,x,y,z);
  GetPlayerFacingAngle(playerid,a);
}

Also you have a variable called SpawnedVehicle[MAX_PLAYERS];, which is obviously used to determine if a vehicle is spawned or not, this is useless because Vehicle[MAX_PLAYERID]; will show 0 until a vehicle is assigned to it, and you could just set that variable back to 0 whenever a vehicle is destroyed.

This
pawn Код:
if(Vehicle[playerid])
{
  DestroyVehicle(Vehicle[playerid]);
  Vehicle[playerid]=0;
}
Is just like
pawn Код:
if(SpawnedVehicle[playerid])
{
  DestroyVehicle(Vehicle[playerid]);
  SpawnedVehicle[playerid]=0;
}
But the first one will reduce your heap size.

You shouldn't be experiencing any issues regardless of either of these methods.
Reply
#5

I did those like you described and its still doing it, just for id 13 o_0
Reply
#6

Quote:
Originally Posted by [mad
MLK (dino-host.net) ]
I did those like you described and its still doing it, just for id 13 o_0
His post was not directed to fix your problem, it was directed to make your script more efficient.
Reply
#7

Quote:
Originally Posted by Joe Staff
Nothing huge, multiple creations of the same variable could be reduced by making global temporary variables.
Some good optimizations but once you think about it a slight bit, there needs to be a small change. Vehicles should be assigned to -1 or anything similar as 0 is still a vehicle ID.

Also, I've looked through the script and here is a new pastebin for ya:

http://extremo.pastebin.com/f2cd96f9

So, I've looked through it and I knew what is needed to cause a problem like yours. Well, after all there is no RemovePlayerFromVehicle in there and all it does is delete it once the player executes the command. There is no actual way for it to delete the vehicle after 10 seconds as not even a timer exists. It might be other filterscripts or your gamemode interfering with your filterscript. As soon as the vehicle exists, it can be deleted by any running script, as the ID is valid for all the scripts.

PS: Had to make a new pastebin with optimization to understand what you had changed.
Reply
#8

Lol

Код:
:\Users\user\Desktop\vdialogg.pwn(67) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(67) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(67) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(68) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(72) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(94) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(94) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(94) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(95) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(99) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(120) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(120) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(120) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(121) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(125) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(146) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(146) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(146) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(147) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(151) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(172) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(172) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(172) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(173) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(177) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(198) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(198) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(198) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(199) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(203) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(224) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(224) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(224) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(225) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(229) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(250) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(250) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(250) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(251) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(255) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(276) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(276) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(276) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(277) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(281) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(302) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(302) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(302) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(303) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(307) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(328) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(328) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(328) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(329) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(333) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(354) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(354) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(354) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(355) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(359) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(380) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(380) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(380) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(381) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(385) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(406) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(406) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(406) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(407) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(411) : error 017: undefined symbol "angle"
C:\Users\user\Desktop\vdialogg.pwn(432) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(432) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(432) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(433) : warning 213: tag mismatch
C:\Users\user\Desktop\vdialogg.pwn(437) : error 017: undefined symbol "angle"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


15 Errors.
Reply
#9

Oh crap, lol.

Fixing it quickly.. i forgot the Float: i guess and i forgot to ex-change some angle variable with the new one i made.. sec.
Reply
#10

As I have already told you dude, update your script to the current release (0.2a not 0.1c) as it has this feature included and it only deals with dialog created vehicles meaning it won't start destroying your gamemode vehicles etc.

Just search for "vDialog".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)