Jump to content
  • 0

problema crb


Mister

Question

Problema intalnita (descriere): Comanda /crb 8 creaza cuie pe jos se sparg rotile dar cand dau /rrball nu se sterge. dece?
Ero(area / rile) / warning-(ul / urile): 0 erori
Liniile de cod / sursa / script-ul:

 

 

else if (rb == 8)
            {
                
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                 spike = CreateObject(2892, plocx, plocy, plocz-0.6,0,0,ploca-90);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
                return 1;
            }

 

Imagini / Video (optional):
Ati incercat sa rezolvati singur?: pai pot sa creeze inloc de

 

 

CreateObject(2892, plocx, plocy, plocz-0.6,0,0,ploca-90);

 

sa fac CreateRoadblock(2892, plocx, plocy, plocz-0.6,ploca-90);

 

dar cum iau coordonatele x y z de la  CreateRoadblock

 

PS: Problema este cum fac sa iau zoordonatele de la roadblock sau cum sa dau remove la createobject

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

Incearca sa faci ID-uri pt road-urile respective , de ex:

 

Road[playerid][RoadID]

 

Road[playerid][RoadID] = CreateObject(.....);

 

dp sa le stergi va fi f usor...

 

for(new i = 0; i < MAX_ROADS; i++)

{

if(!IsValidObject(Road[playerid][RoadID]))

continue;

DestroyObject(Road[playerid][RoadID]);

Road[playerid][RoadID] = -1;

}

Eu am dat un exemplu mai sus , ca doar nu am sa-ti fac eu scriptu :) e ajutor scripting nu ... vreau script sau ceva de gen... Ai exemplu mai sus , restu trebuie sa te descurci singur

  • Upvote 1
public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

comanda am creat eu nu am pus nimic la /rub sau /rrball deci e la fel ca la orice gm

 if (strcmp(cmd,"/rrball",true) == 0 || strcmp(cmd, "/removeroadblockall", true) == 0)
    {
        if(IsPlayerConnected(playerid) && IsACop(playerid)  || PlayerInfo[playerid][pAdmin] >= 2)
         {
            if(PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pAdmin] >= 2) // This being the default Chief rank in LA-RP change if neccesary.
            {
           
                DeleteAllRoadblocks(playerid);
                format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
                new y, m, d;
                new h,mi,s;
                getdate(y,m,d);
                gettime(h,mi,s);
                format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblockall",d,m,y,h,mi,s,sendername);
                CommandLog(string);
            }
        }
        return 1;
    }
Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

stock DeleteAllRoadblocks(playerid)
{
    for(new i = 0; i < sizeof(Roadblocks); i++)
      {
          if(IsPlayerInRangeOfPoint(playerid, 100, Roadblocks[sX], Roadblocks[sY], Roadblocks[sZ]))
        {
              if(Roadblocks[sCreated] == 1)
              {
                  Roadblocks[sCreated] = 0;
                Roadblocks[sX] = 0.0;
                Roadblocks[sY] = 0.0;
                Roadblocks[sZ] = 0.0;
                DestroyDynamicObject(Roadblocks[sObject]);
              }
          }
    }
    return 0;
}

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

if (strcmp(cmd,"/rrball",true) == 0 || strcmp(cmd, "/removeroadblockall", true) == 0)
  {
    if(IsPlayerConnected(playerid) && IsACop(playerid)|| PlayerInfo[playerid][pAdmin] >= 2)
     {
      if(PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pAdmin] >= 2) // This being the default Chief rank in LA-RP change if neccesary.
      {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(PlayerInfo[pRoadblock] != 0)// Aici modifici tu pRoadBlock cu ce ai in gm pentru a crea RB-ul.
                {
                    DeleteAllRoadblock(i);
                }
            }
          format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",sendername);
          SendRadioMessage(1,COLOR_BLUE,string);
          GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
          new y, m, d;
        new h,mi,s;
        getdate(y,m,d);
        gettime(h,mi,s);
        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblockall",d,m,y,h,mi,s,sendername);
        CommandLog(string);
      }
    }
    return 1;
  }

Incearca asa.

 

 

Link to comment
Share on other sites

pai cand scriu /crb 0 creaza un obiect nu ar fi normal sa mearga asa?

 new Float:RotX,Float:RotY,Float:RotZ;
                   new Float:x, Float:k, Float:z;
                   GetObjectRot(spike, RotX, RotY, RotZ);
                GetObjectPos(spike, x, k, z);
                RemoveBuildingForPlayer(playerid,2892,x,k,z,RotX);

Dar nu este bine asa pentru ca merge doar o bariera de cuie sa pui a doaua daca o pui nu mai poti sa o stergi pe anterioara

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Salut, 

Ph0eniX

am facut asa

/crb

             {
       40947         Road[playerid][RoadID]
                   PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                Road[playerid][RoadID] = 1;
                Road[playerid][RoadID] = CreateObject(2892, plocx, plocy, plocz-0.95,0,0,ploca-90);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
                return 1;
            }

si .rub sa scot bariera

 if (strcmp(cmd,"/rub",true) == 0 || strcmp(cmd, "/removeroadblock", true) == 0)
    {
        if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
         {
             for(new i = 0; i < MAX_ROADS; i++)
            {
                if(!IsValidObject(Road[playerid][RoadID]))
                continue;
                DestroyObject(Road[playerid][RoadID]);
                Road[playerid][RoadID] = -1;
            }
        }
        return 1;
    }

si da eroare la /crb

 

 

 

C:UsersADesktopserverrebriston-GOV --gmgamemodeslarp.pwn(40947) : error 017: undefined symbol "Road"
C:UsersADesktopserverrebriston-GOV --gmgamemodeslarp.pwn(40947) : warning 215: expression has no effect
C:UsersADesktopserverrebriston-GOV --gmgamemodeslarp.pwn(40947) : error 001: expected token: ";", but found "]"
C:UsersADesktopserverrebriston-GOV --gmgamemodeslarp.pwn(40947) : error 029: invalid expression, assumed zero
C:UsersADesktopserverrebriston-GOV --gmgamemodeslarp.pwn(40947) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright © 1997-2006, ITB CompuPhase


4 Errors.
 

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Eu ti-am dat un exemplu ... nu ti-am dat sa scrii fix aia

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

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.