Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

Problema intalnita (descriere):Cand dai /find nu se tine de pe player si ramane Checkpoint il locul in care a fost ultima data trebuie sa dai intruna find 
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu):

CMD:find(playerid, params[])
{
    new targetID;
    if(sscanf(params, "u", targetID)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/find [playerid]");
    {
        if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 || jobVariables[playerVariables[playerid][pJob]][jJobType] == 2 || groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 12)
        {
            new name[MAX_PLAYER_NAME];
            GetPlayerName(targetID, name, MAX_PLAYER_NAME);
            FindTime[playerid] = 10000;
            PlayerFind[playerid] = targetID;
            new Float: x, Float: y, Float: z;
            GetPlayerPos(targetID,x,y,z);
            new Float: fDistance = GetPlayerDistanceFromPoint(playerid, x,y,z);
            format(szMessage, 256, "Server has set you a checkpoint to %s (%d). Distance: %.0f meters.",name, targetID, fDistance);
            SCM(playerid,COLOR_YELLOW, szMessage);
            SetPlayerCheckpoint(playerid,x,y,z,3.0);
        }
    }
    return 1;
}
forward AttachTrailTruck(trailer, car);
public AttachTrailTruck(trailer, car)
{
    AttachTrailerToVehicle(trailer, car);
    return 1;
}
Imagini / Video (optional):
Ati incercat sa rezolvati singur? Nu stiu ce sa ii fac sa se tina dupa player

5 answers to this question

Recommended Posts

  • 0
Posted

            new id,giveplayer[30],string[100];
           if(IsACop(playerid) || PlayerInfo[playerid][pLeader] || PlayerInfo[playerid][pMember] == 11) // Asta o poti sterge, depinde.
            {
                if(sscanf(params, "u",id)) return SendClientMessage(playerid, 0xFFFFFFFF, "Tasteaza: /find <Name/Playerid>");
                if(IsPlayerConnected(id))
                {
                    if(id != INVALID_PLAYER_ID)
                    {
                        if(id == playerid) return SendClientMessage(playerid, 0xFFB870FF, "You cannot find yourself.");
                        if(togfind[id] == 1) return SCM(playerid,COLOR_WHITE,"Player not connected.");
                        UsedFind[playerid] = 1;
                        GetPlayerName(id, giveplayer, sizeof(giveplayer));
                        new Float:X,Float:Y,Float:Z;
                        GetPlayerPos(id, X,Y,Z);
                        SetPlayerCheckpoint(playerid, X,Y,Z, 3.5);
                        CP[playerid] = 43;
                        targetfind[playerid] = id;
                        if(IsPlayerInArea(id, -2997.40, -1115.50, -1213.90, 1659.60))

 

In loc de          

 

 new name[MAX_PLAYER_NAME];
            GetPlayerName(targetID, name, MAX_PLAYER_NAME);
            FindTime[playerid] = 10000;
            PlayerFind[playerid] = targetID;
            new Float: x, Float: y, Float: z;
            GetPlayerPos(targetID,x,y,z);
            new Float: fDistance = GetPlayerDistanceFromPoint(playerid, x,y,z);
            format(szMessage, 256, "Server has set you a checkpoint to %s (%d). Distance: %.0f meters.",name, targetID, fDistance);
            SCM(playerid,COLOR_YELLOW, szMessage);
            SetPlayerCheckpoint(playerid,x,y,z,3.0);

  • 0
Posted (edited)

Am pus comanda asa si nu merge 

 

 

 CMD:find(playerid, params[])
            {
            new id,giveplayer[30],string[100];
           if(IsACop(playerid) || PlayerInfo[playerid][pLeader] || PlayerInfo[playerid][pMember] == 11) // Asta o poti sterge, depinde.
            {
                if(sscanf(params, "u",id)) return SendClientMessage(playerid, 0xFFFFFFFF, "Tasteaza: /find <Name/Playerid>");
                if(IsPlayerConnected(id))
                {
                    if(id != INVALID_PLAYER_ID)
                    {
                        if(id == playerid) return SendClientMessage(playerid, 0xFFB870FF, "You cannot find yourself.");
                        if(togfind[id] == 1) return SCM(playerid,COLOR_WHITE,"Player not connected.");
                        UsedFind[playerid] = 1;
                        GetPlayerName(id, giveplayer, sizeof(giveplayer));
                        new Float:X,Float:Y,Float:Z;
                        GetPlayerPos(id, X,Y,Z);
                        SetPlayerCheckpoint(playerid, X,Y,Z, 3.5);
                        CP[playerid] = 43;
                        targetfind[playerid] = id;
                        if(IsPlayerInArea(id, -2997.40, -1115.50, -1213.90, 1659.60))
             new name[MAX_PLAYER_NAME];
            GetPlayerName(targetID, name, MAX_PLAYER_NAME);
            FindTime[playerid] = 10000;
            PlayerFind[playerid] = targetID;
            new Float: x, Float: y, Float: z;
            GetPlayerPos(targetID,x,y,z);
            new Float: fDistance = GetPlayerDistanceFromPoint(playerid, x,y,z);
            format(szMessage, 256, "Server has set you a checkpoint to %s (%d). Distance: %.0f meters.",name, targetID, fDistance);
            SCM(playerid,COLOR_YELLOW, szMessage);
            SetPlayerCheckpoint(playerid,x,y,z,3.0);
            {
            return 1;
            }

Edited by marius11
  • 0
Posted (edited)

La un timere de o secunda trebuie sa pui ceva de genu   (acel timer trebuie sa aiba si for(new i;i<MAX_PLAYERS;i++)  )

 

if(PlayerFind[i] != INVALID_PLAYER_ID)

{

    new Float:X,Flaot:Y,Float:Z;
    GetPlayerPos(PlayerFind[i],X,Y,Z);
    SetPlayerCheckpoint(i,x,y,z,3.0);

}

 

 

 

La OnPlayerConnect pui asta

PlayerFind[playerid] = INVALID_PLAYER_ID;

 

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
  • 0
Posted (edited)

Dar exact asta am facut eu mai sus, vrei scriptu gata ti-am zis sa pui ce am scris eu la un timer, timerele le cauti la ongamemodeinit, timerul trebuie sa aiba variabila "playerid" asociata cu "i" daca e un for sau un foreach, mai simplu de atat nu pot sa explic.

EDIT: Cauta cu ctrl+f   "public SetPlayerUnjail"    si pune codul asta 

if(PlayerFind[i] != INVALID_PLAYER_ID)

{

    new Float:X,Flaot:Y,Float:Z;
    GetPlayerPos(PlayerFind[i],X,Y,Z);
    SetPlayerCheckpoint(i,x,y,z,3.0);

}
Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.