Little coding questions - For general minor queries 5

I have a problem. When I am in the class selection it doesnt show any players / cars that I have placed even though I added what can be seen below.

Help me please

Code:
public OnPlayerConnect(playerid)
{
	SetPlayerInterior(playerid, 0);
	return 1;
}
Screenshots:
http://i.imgur.com/DA2mm2o.jpg http://i.imgur.com/PnsBbMy.jpg
Reply

https://sampforum.blast.hk/showthread.php?tid=435043

It's not your script but rather how SA-MP works so to combat this you need to stream the vehicle for them. Read KyleSmith's reply in the thread above.
Reply

Hi, anyone has any idea how shall i detect when a player shoots a rocket from the normal rocket launcher?

Edit: OnPlayerKeyStateChange
Reply

Quote:
Originally Posted by Ralfie
View Post
Hi, anyone has any idea how shall i detect when a player shoots a rocket from the normal rocket launcher?

Edit: OnPlayerKeyStateChange
Just an Idea, OnPlayerWeaponShot ?

If not that, use GetPlayerWeapon with OnPlayerKeyStateChange to check if the weapon is used. You may want to check the ammo aswell.

That's what i can think of as possible solutions

And if your "edit" stated that you found out, please write that specifically next time :P
Reply

Quote:
Originally Posted by denNorske
View Post
Just an Idea, OnPlayerWeaponShot
Is not called with melee or rockets, grenades, etc
Reply

Thank you dude! Repped
Reply

Quote:
Originally Posted by Counterafk
Посмотреть сообщение
Thank you dude! Repped
Hahaha no problem I like helping people, btw since you got 0 rep points your rep doesn't count to others, I repped you back so your REP is now working
Reply

-Delete, double posted same question-
Reply

How do I reset SQL AUTO_INCREMENT?
Aka how do I make it start from 0 again after Ive deleted many stuff from it

Example:

ID 1 Account
ID 2 Account
ID 3 Account

and now I delete them all, but it continues doing

ID 4 Account
ID 5 Account

While the 1,2,3 are empty.
I want to basically reset that so it starts from 0 again


I got AUTO_INCREMENT & PrimaryKey set as ID


EDIT: Sorry for double post, was accident.
Reply

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
How do I reset SQL AUTO_INCREMENT?
Aka how do I make it start from 0 again after Ive deleted many stuff from it

Example:

ID 1 Account
ID 2 Account
ID 3 Account

and now I delete them all, but it continues doing

ID 4 Account
ID 5 Account

While the 1,2,3 are empty.
I want to basically reset that so it starts from 0 again


I got AUTO_INCREMENT & PrimaryKey set as ID


EDIT: Sorry for double post, was accident.
Am pretty sure running this SQL should reset all the numbers from 1.
Код:
ALTER TABLE tablename AUTO_INCREMENT = 1
Make sure to not run that on every insert though just run it only once, This code rebuilds the whole table so if you have a huge one, it might take ages.
Reply

Can anybody confirm that OnPlayerEditAttachedObject is working at the moment?

Thats my code and i dont get the Test Message

Код:
 public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{

		 SendClientMessage(playerid, 0xFF0000FF, "Test");
                 if(0.0 < fScaleX <=  1.5 || 0.0 <  fScaleY <=  1.5 || 0.0 < fScaleZ <=  1.5)
		  {
			SendClientMessage(playerid, 0xFF0000FF, "* Dein Item wird zu groЯ oder zu klein!");
			new item;
			item = GetPVarInt(playerid,"brille");
			SetPlayerAttachedObject(playerid, 3, item, 2, 0.201, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1, -1);
			EditAttachedObject(playerid, 3); // Edit again

		  }
		if(0.0 < fOffsetX <= 0.5 || 0.0 < fOffsetY <= 0.5 || 0.0 < fOffsetZ <= 0.5)
		  {
			SendClientMessage(playerid, 0xFF0000FF, "* Dein Item wird zu groЯ oder zu klein!");
			new item;
			item = GetPVarInt(playerid,"brille");
			SetPlayerAttachedObject(playerid, 3, item, 2, 0.201, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1, -1);
			EditAttachedObject(playerid, 3); // Edit again

		  }
}
thx
Reply

Hey, maybe someone knows how to modify a spray can? I mean that a spray can could spray fire. Should I make a fire object when the player starts spraying or something?
Reply

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
You can! In fact, you can use the filterscript tool mention in my previous post to get the attachment coordinates. But to set victims on fire you'll have to do a bit more work.
You didn't got me right, bro. I want to remove spray can spraying "gas" and make it to spray flames, just like in this video: https://www.youtube.com/watch?v=tl7guA2XwOA, 1:05.

I saw that when he left his car the flames just comes out automatically, so I think I should create an object OnPlayerCommand and change it (or multiple) to make it look abit bigger when the KEY_FIRE is pressed or something like that. Can you give me some advise how can I make it?
Reply

Thanks man, you helped me alot. Have a good night.
Reply

Yo, I got an argument type mismatch 2 on this code right here:

Код:
				format(points,sizeof(points)," You need [%d] Exp Points in order to level up, You currently have [%d]",expamount,PlayerInfo[playerid][pExp]); // Format, This is pretty obvious.
				SendClientMessage(playerid,COL_LIME,points); // Sends the message.
can anyone help me out?
Reply

Which specifiers for 0xFFFF00AA ? I tried %s but it returned to 0šf3FF00AA
Reply

Quote:
Originally Posted by Mrcroissant
View Post
Which specifiers for 0xFFFF00AA ? I tried %s but it returned to 0љf3FF00AA
that's a number in the hexadecimal format. So try %x
Reply

How often is OnPlayerUpdate called?
Reply

Quote:
Originally Posted by Amads
View Post
How often is OnPlayerUpdate called?
If I recall correctly, it's either every 5ms or every 20ms. It does vary a lot depending on server load/client connections (maybe). You can find out for yourself with a simple GetTickCount() comparison between calls.
Reply

Quote:
Originally Posted by [HLF]Southclaw
View Post
If I recall correctly, it's either every 5ms or every 20ms. It does vary a lot depending on server load/client connections (maybe). You can find out for yourself with a simple GetTickCount() comparison between calls.
It also depends a lot on what the play is doing. Say if you're just standing still, maybe it calls two to four times a second. If you're running around with an UZI shooting shit up then you'll find it calls up to twenty, thirty, forty calls a second.

Also note that that is that many times per second per player.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)