Job bug..
#2

Why're you using SetPlayerRaceCheckpoint if you aren't gonna make use of nextx, nexty, and nextz parameters?

Just use SetPlayerCheckpoint. And the problem most likely is GetPVarType.

GetPVarType returns the type of the PVar. What you're looking for is GetPVarInt.

https://sampwiki.blast.hk/wiki/GetPVarType
https://sampwiki.blast.hk/wiki/GetPVarInt

Also a suggestion, your code is very messy and could be simpler. I recommend making an array, for example:

PHP код:
enum E_CHECKPOINT_DATA
{
    
Float:P_CHECKPOINT_X,
    
Float:P_CHECKPOINT_Y,
    
Float:P_CHECKPOINT_Z,
    
Float:P_CHECKPOINT_NEW_X,
    
Float:P_CHECKPOINT_NEW_Y,
    
Float:P_CHECKPOINT_NEW_Z
}
new 
g_aCheckpointData[][E_CHECKPOINT_DATA] = 
{
    {
1701.7723, -1505.400313.38281699.6165, -1538.992213.3828}
};
CMD:deliver(playeridparams[])
{
    new
        
str[128],
        
index = -1
    
;
    for(new 
0sizeof g_aCheckpointDatai++)
    {
        if(
IsPlayerInRangeOfPoint(playerid3.0g_aCheckpointData[i][P_CHECKPOINT_X], g_aCheckpointData[i][P_CHECKPOINT_Y], g_aCheckpointData[i][P_CHECKPOINT_Z]))
        {
            
index i;
            break;
        }
    }
    
    if(
index != -1)
    {
        
format(strsizeof(str), "You're near coordinates %f, %f, %f in checkpoint data %i."g_aCheckpointData[index][P_CHECKPOINT_X], g_aCheckpointData[index][P_CHECKPOINT_Y], g_aCheckpointData[index][P_CHECKPOINT_Z], index);
        
SendClientMessage(playerid, -1str); 
        
        
SetPlayerCheckpoint(playeridg_aCheckpointData[index][P_CHECKPOINT_NEW_X], g_aCheckpointData[index][P_CHECKPOINT_NEW_Y], g_aCheckpointData[index][P_CHECKPOINT_NEW_Z], 5.0);
    }
    return 
1

Results.
Reply


Messages In This Thread
Job bug.. - by Puff - 08.09.2017, 10:57
Re: Job bug.. - by Kane - 08.09.2017, 11:19

Forum Jump:


Users browsing this thread: 1 Guest(s)