SA-MP Forums Archive
Silenced Pistol Speed Checker - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Silenced Pistol Speed Checker (/showthread.php?tid=185518)



Silenced Pistol Speed Checker - Ritchie999 - 24.10.2010

I'm wondering if it's possible to turned the Silenced pistol into a speed checker weapon for police
For example

Код:
*Shoots Car*
"ShowTextDrawForPlayer(playerid,VehicleSpeed);"
*Returns text draw and shows how fast the car is was going when you shot judging from the speedometer you are using*
*10 Second Timer For Textdraw*
"HideTextDrawforPlayer(playerid);
So, is this possible? What functions would i use to do it?


Re: Silenced Pistol Speed Checker - Lenny the Cup - 24.10.2010

Yes, but the car would be hit by a bullet and probably scare the shit out of the driver, causing him to speed :P


Re: Silenced Pistol Speed Checker - Whizion - 25.10.2010

Well real police doesn't shoot you they just aim at you with that thingy.


Re: Silenced Pistol Speed Checker - Ritchie999 - 25.10.2010

Lol @ Lenny..

@Whizion there is no object to aim in GTA.. By shooting the car im guessing it will make contact and return the speed.. If there is any other way, please say so. I was worried about the gun technique too, It would damage the car


Re: Silenced Pistol Speed Checker - WillyP - 25.10.2010

ive made a script that im sure will work.

just i need to test


Re: Silenced Pistol Speed Checker - Ritchie999 - 25.10.2010

Launch it up on a server and PM me the IP, i'll help ya test it


Re: Silenced Pistol Speed Checker - Ritchie999 - 25.10.2010

Sorry to bump this.. But has anyone got a similar system like this or can show me the functions to use.

Yeah, i've searched, but i have absolutely no idea what this is called, if i put "Speed" only speedometers come up


Re: Silenced Pistol Speed Checker - FujiNNN - 25.10.2010

yeah is it possible to do a speed gun like if player standing still and aiming at vehicle and the vehicle is at move and the aimer will aim at the vehicle and the vehicle will return the speed of it?


Re: Silenced Pistol Speed Checker - Calgon - 25.10.2010

Put the code under OnPlayerKeyStateChange, check if key = fire, perform a check of which weapon the player is using, use GetPlayerCameraPos, get the vehicle ID from the position (perform a loop of all vehicles in range of where the shot was at), use one of the pre-existing speed checking functions on the vehicle ID, send a textdraw with the speed etc.

Shady91 scripted something similar a while ago that he showed me ([ame]http://www.youtube.com/watch?v=K01H38bLVRc[/ame]) which may be released in his 'City Role Play' script.

I would have written the code for you, but I can't really be bothered.


Re: Silenced Pistol Speed Checker - Ritchie999 - 25.10.2010

I've taken the one from City Role Play
Fixed up alot of errors, now these are the only errors left, Anyone got any idea how to fix em up?

Код:
 (17630) : error 035: argument type mismatch (argument 2)
 (17631) : error 035: argument type mismatch (argument 2)
 (17632) : error 035: argument type mismatch (argument 2)
Код:
    if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1) return SendClientMessage(playerid, "You need to be a cop to use this.");
    if(GetPVarInt(playerid, "SpeedGunStat") == 1) return KillTimer(GetPVarInt(playerid, "SpeedGunTimer")), SetPVarInt(playerid, "SpeedGunStat", 0), TextDrawDestroy(Text:GetPVarInt(playerid, "SpeedoDraw")), SendClientMessage(playerid, "You turned your speedo gun off");
    SetPVarInt(playerid, "SpeedGunTimer", SetTimerEx("GetCarSpeed", 1000, 1, "i", playerid)); GivePlayerWeapon(playerid, 43, 1); SendClientMessage(playerid, "You turned on your speed gun.");
Код:
(20539) : error 035: argument type mismatch (argument 2)
Код:
if(GetPVarInt(playerid, "SpeedGunWatch") == 20) return KillTimer(GetPVarInt(playerid, "SpeedGunTimer")), SetPVarInt(playerid, "SpeedGunStat", 0), TextDrawDestroy(Text:GetPVarInt(playerid, "SpeedoDraw")), SendClientMessage(playerid, "Your speed gun was turned off as it was not being used.");
Код:
(20585) : warning 208: function with tag result used before definition, forcing reparse
Код:
stock IsPlayerAimingAt(playerid, Float:x, Float:y, Float:z, Float:radius)