Little coding questions - For general minor queries 5

What is the difference between a debian version and a debian static version?
Reply

What would be a plausible way to detect if a players hitting a vehicle with fists or melee weapons?

EDIT:

Found a way that's most convenient for what I was planning on. This was mostly for affect on the driver's door. If anyone's interested:

Use OnPlayerKeyStateChange.

PHP код:
if(RELEASED(KEY_FIRE))
{
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_FRONTSEATcXcYcZ);
GetVehicleRelativePos(vehicleiddXdYdZ, -cX 0.5cYcZ);
            
if(!
IsPlayerInRangeOfPoint(playerid1.2dXdYdZ))
     return 
1;

GetVehicleRelativePos isn't a native function so you'll have to find that.
Reply

There is a color chart for ShowInfoText ?
Reply

What are the useful and important informations to extract from the profiler? What which columns means?
Those questions are quite stupid but I don't want to misunderstand something.
Edit: I see some callbacks twice like FIXES_OnPlayerConnect & OnPlayerConnect, what does that mean?
Reply

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
What are the useful and important informations to extract from the profiler? What which columns means?
https://github.com/Zeex/samp-plugin-...ki/Terminology
Reply

https://www.youtube.com/watch?v=WhZerRzXkTM Help please!
Reply

Quote:
Originally Posted by SmithJohnos
Посмотреть сообщение
It probably means that your internet is getting censored, or your IP address (block) is set to DROP on the side of the server.
Reply

Thank you!
Reply

Isn't that possible to do with foreach ?
PHP код:
for(new random_numberMAX_HOUSEi++) 
I want to loop through the iterator but I want to start at a certain value.

Edit:
PHP код:
foreach(new random_number Ite_Houses)
or
foreach(new 
random_number Ite_Houses
That break macros.
Reply

Quote:
Originally Posted by PatrickGTR
Посмотреть сообщение
@Dayrion

Just declare it like this..

pawn Код:
new i = random_number;
foreach(i : Ite_Houses)
{

}
That won't work. It will loop Ite_Houses with the value, not at least with the value : random_number
Reply

Quote:
Originally Posted by Derzhavin
Посмотреть сообщение
i created chechpoint for the taxi driver, he have 'i' , passenger have 'playerid'
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
        if(
IsPlayerInRangeOfPoint(playerid,2.0,781.5677,841.8466,5.8482))
        {
              
PlayerInfo[playerid][pCash] += 500;
            
DisablePlayerCheckpoint(playerid);
            
SCM(playeridCOLOR_GREEN"u get 500$");
        }
        return 
true;
        } 
The checkpoint is set for the driver, so he will enter the checkpoint as playerid
Reply

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
If you're using onplayerentercheckpoint what's that " i" for?
Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
        if(
IsPlayerInRangeOfPoint(playerid,2.0,781.5677,841.8466,5.8482))
        {
              
PlayerInfo[playerid][pCash] += 500;
            
DisablePlayerCheckpoint(playerid);
            
SCM(playeridCOLOR_GREEN"u get 500$");
        }
        return 
true;
        } 
The checkpoint is set for the driver, so he will enter the checkpoint as playerid
nothing

picture
Reply

bump
Reply

pls guys, it's very important
Reply

how can i write the command? i need that player follow player. i think u know that. it's using in samp police system
Reply

Does pawn's float have rounding errors? Can I use '==' with Float: without worrying about .00000001 values?
Reply

Hey. I should misunderstood something about Dynamic 3D Text Label.
I've this code
PHP код:
CMD:test_label(playeridparams[])
{
    
extract params -> new player:targetid; else return 0;
    new 
Float:x,
        
Float:y,
        
Float:z;
    
GetPlayerPos(targetidxyz);
    
CreateDynamic3DTextLabel("TEST LABEL123456"0xFF0000FFxy5.030.0targetid_, .testlos 1, .playerid playerid);
    return 
1;

The label is correctly created (even if the pose is the same despite of the z) but I can't see him though objects like testlos should. If anyone have ideas, tips, or something I'll take it.
Reply

Can i divide vehicle velocity by 1/2?
Im gonna explain
On a lot of servers velocity is neutral. Im riding a bike and it says im going 130 KH/h. Nonsense.
Is there a way to divide velocity for example if im going 100 km/h it says 50. Only 2 exceptions if im going 1 it doesnt say 0.5 but 1 km/h BUT if im going 1.5kmh it says 1kmh and so on. Is it possible?
Reply

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Hey. I should misunderstood something about Dynamic 3D Text Label.
I've this code
PHP код:
CMD:test_label(playeridparams[])
{
    
extract params -> new player:targetid; else return 0;
    new 
Float:x,
        
Float:y,
        
Float:z;
    
GetPlayerPos(targetidxyz);
    
CreateDynamic3DTextLabel("TEST LABEL123456"0xFF0000FFxy5.030.0targetid_, .testlos 1, .playerid playerid);
    return 
1;

The label is correctly created (even if the pose is the same despite of the z) but I can't see him though objects like testlos should. If anyone have ideas, tips, or something I'll take it.
You have to set the testlos to 0. Testlos = test Line of Sight, so you don't want it to test the line of sight. With 1, if there's an object on the line to the label, the label won't appear.
Reply

Quote:
Originally Posted by Derzhavin
Посмотреть сообщение
can u help me? when i get checkpoint nothing happens

Код:
				if(PlayerInfo[i][pJob] == 2 && PlayerInfo[i][TaxiS] == 02)
				{
					if(IsTaxi(i) && GetPlayerState(i) == 2 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
					{
						if(PlayerInfo[playerid][pLevel] == 1)
						{
						new stringl[256];
						format(stringl,sizeof(stringl),"%s in your taxi.",PlayerInfo[playerid][pName]);
						SendClientMessage(i,0x0099FFAA, stringl);
						format(stringl,sizeof(stringl),"you in %s 's taxi.",PlayerInfo[i][pName]);
						SendClientMessage(playerid,0x0099FFAA, stringl);
						SetPlayerCheckpoint(i, 781.5677,841.8466,5.8482,5.0);
      					cKar[i] = 1;
						}
	  					else
	  					{
	  					    SCM(playerid, COLOR_RED, "Social taxi only for newbie");
	  					    RemovePlayerFromVehicle(playerid);
				    	}
					}
				}
public OnPlayerEnterCheckpoint(playerid)

Код:
		if(IsPlayerInRangeOfPoint(i,2.0,781.5677,841.8466,5.8482))
		{
	  		PlayerInfo[i][pCash] += 500;
	        DisablePlayerCheckpoint(i);
	        SCM(i, COLOR_GREEN, "u get 500$");
		}
		return true;
		}
still have problems
Reply


Forum Jump:


Users browsing this thread: 17 Guest(s)