#1

Sometimes the checkpoint is not placed on the player, the checkpoint is sometimes made incorrect.
Sometimes /cancelfind not work, does not delete checkpoint.

Код HTML:
CMD:find(playerid, params[]) 
{ 
    if(pInfo[playerid][pJob] != 1) return SendClientMessage(playerid, COLOR_DARKGRAY,"You're not a detective!");
    new targetid; new Float:x, Float:y, Float:z; 
    if(sscanf(params,"u", targetid)) return SendSyntaxMessage(playerid, "/find [playerid/PartOfName]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_DARKGRAY,"Invalid player!");
    GetPlayerPos(targetid, x, y, z); 
    SetPlayerCheckpoint(playerid, x, y, z, 4.0);
    FindTimer[playerid] = SetTimerEx("findPlayer", 1000, 1, "ii", targetid, playerid);
    FindP[playerid] = 1;
    return 1; 
}
Код HTML:
forward findPlayer(targetid, playerid);
public findPlayer(targetid, playerid)
{
    if(FindP[playerid] == 1)
    {
        if(!IsPlayerConnected(targetid))
        { 
            DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~r~player has disconnected", 3000, 5); 
            KillTimer(FindTimer[playerid]);
            FindTimer[playerid] = -1;
            FindP[playerid] = -1;
            return 1;
        }
        new Float:x, Float:y, Float:z;
        GetPlayerPos(targetid, x, y, z);
        SetPlayerCheckpoint(playerid, x, y, z, 4.0);
    }
    return 1;
}
Код HTML:
CMD:cancelfind(playerid, params[]) 
{ 
    if(pInfo[playerid][pJob] != 1) return SendClientMessage(playerid, COLOR_DARKGRAY,"You're not a detective!");
    if(FindP[playerid] == 1)
    {
        KillTimer(FindTimer[playerid]);
        FindTimer[playerid] = -1;
        DisablePlayerCheckpoint(playerid);
        GameTextForPlayer(playerid, "~r~canceled find", 3000, 5);
        FindP[playerid] = -1;
    }
    return 1; 
}
Reply
#2

Try this

PHP код:

CMD
:find(playeridparams[]) 

    if(
pInfo[playerid][pJob] != 1) return SendClientMessage(playeridCOLOR_DARKGRAY,"You're not a detective!");
    new 
targetidFloat:xFloat:yFloat:z
    if(
sscanf(params,"u"targetid)) return SendSyntaxMessage(playerid"/find [playerid/PartOfName]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_DARKGRAY,"Invalid player!");
    
GetPlayerPos(targetidxyz); 
    
SetPlayerCheckpoint(playeridxyz4.0);
    
FindTimer[playerid] = SetTimerEx("findPlayer"10001"ii"targetidplayerid);
    return 
1

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)