Virtual World Shooting
#1

I'm looking for a start/beginning of a script that if you shoot you in 1 virtual world you get a new pos and other virt world

Example:
Shooting 3 times in ammunation and you'll get jailed for doing it.

I really don't know how to start scripting this..
If anyone could explain me how to add a If(playerid,Shootsinammunation) = SetPlayerPos & SendClientMessage etc.
I would appreciate this.
Reply
#2

maybe this will help you

Код:
Float:DistanceCameraTargetToLocation(Float:CamX, Float:CamY, Float:CamZ,  Float:ObjX, Float:ObjY, Float:ObjZ,  Float:FrX, Float:FrY, Float:FrZ)
{

	new Float:TGTDistance;

	// get distance from camera to target
	TGTDistance = floatsqroot((CamX - ObjX) * (CamX - ObjX) + (CamY - ObjY) * (CamY - ObjY) + (CamZ - ObjZ) * (CamZ - ObjZ));

	new Float:tmpX, Float:tmpY, Float:tmpZ;

	tmpX = FrX * TGTDistance + CamX;
	tmpY = FrY * TGTDistance + CamY;
	tmpZ = FrZ * TGTDistance + CamZ;

	return floatsqroot((tmpX - ObjX) * (tmpX - ObjX) + (tmpY - ObjY) * (tmpY - ObjY) + (tmpZ - ObjZ) * (tmpZ - ObjZ));
}
stock IsPlayerAimingAt(playerid, Float:x, Float:y, Float:z, Float:radius)
{
    new Float:cx,Float:cy,Float:cz,Float:fx,Float:fy,Float:fz;
    GetPlayerCameraPos(playerid, cx, cy, cz);
    GetPlayerCameraFrontVector(playerid, fx, fy, fz);
    return (radius >= DistanceCameraTargetToLocation(cx, cy, cz, x, y, z, fx, fy, fz));
}
Reply
#3

You can disable weapons in interiors
Reply
#4

Quote:
Originally Posted by akis_tze
Посмотреть сообщение
maybe this will help you
Not sure what to do with codes.. and what its for :S


Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
You can disable weapons in interiors
I don't want to disable weapons, Theres a weapon menu in it anyways.
Reply
#5

pawn Код:
if(IsPlayerInArea(playerid, ammu_x, ammu_y, ammu_z);
{
    if(newkeys == KEY_FIRE)
    {
        SetPVarInt(playerid, "ShootingAmmu", GetPVarInt(playerid, "ShootingAmmu")+1);
    }
    if(GetPVarInt(playerid, "ShootingAmmu") == 3)
    {
        // jail command
        SetPVarInt(playerid, "ShootingAmmu", 0); // 0 resets the pvar
    }
}
Add that at OnPlayerKeyStateChange
Reply
#6

For what distance is that

Код:
if(IsPlayerInArea(playerid, ammu_x, ammu_y, ammu_z);
Reply
#7

if(IsPlayerInArea(playerid, ammu_x, ammu_y, ammu_z);

You need to put the ammunation coords, go ingame and enter the ammunation do /save then goto C:\Program Files\Rockstar Games\GTA San Andreas\savedpositions.txt

Then get the last one, it would look something like this AddPlayerClass(0,0000,00000,0000,0000,0000,0000);

Which means AddPlayerClass(Skin,PosX,PosY,PosZ (thats all you need to know)

Copy the PosX PosY and PosZ into

ammu_x, ammu_y, ammu_z);

Hope it helps you.
Reply
#8

Quote:
Originally Posted by playbox12
Посмотреть сообщение
if(IsPlayerInArea(playerid, ammu_x, ammu_y, ammu_z);

You need to put the ammunation coords, go ingame and enter the ammunation do /save then goto C:\Program Files\Rockstar Games\GTA San Andreas\savedpositions.txt

Then get the last one, it would look something like this AddPlayerClass(0,0000,00000,0000,0000,0000,0000);

Which means AddPlayerClass(Skin,PosX,PosY,PosZ (thats all you need to know)

Copy the PosX PosY and PosZ into

ammu_x, ammu_y, ammu_z);

Hope it helps you.
That wasn't my question, I asked for what distance it was.
Not how it works.. :S
Reply
#9

It's to check if the player is in the ammu-nation.

But a more simpeler way is getting the interior from the player (or virtualworld for that matter) and see if it's the same as the ammu-nation interior.
Then run a check (IsPlayerInRangeOfPoint) to see if the player is actually in the ammu-nation and not some interior in the same interiorid.
Reply
#10

Oh k, I didn't really understood your question. So I just ergg guessed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)