Question

if(strcmp(cmd, "/object", true) == 0 ){ 
if(PlayerInfo[playerid][pAdmin] < 6){ 
              new objid1; 
              new rot; 
              tmp = strtok(cmdtext, idx); 
              if(!strlen(tmp)) { 
                   SendClientMessage(playerid, CGREY, " /object [ID обьекта] [Угол поворота]"); 
                         return 1; 
         } 
              objid1 = strval(tmp); 
              tmp = strtok(cmdtext, idx); 
              if(!strlen(tmp)) { 
              SendClientMessage(playerid, CGREY, " /object [ID обьекта] [Угол поворота]"); 
              return 1; 
         } 
              new Float:X, Float:Y,Float:Z,Float:rX,Float:rY; 
              GetPlayerPos(playerid, X, Y, Z); 
              rot = strval(tmp); 
              SetPlayerPos(playerid,X,Y,Z +5); 
              CreateObject(objid1, X, Y, Z, rX, rY, rot); 
         }else{SendClientMessage(playerid, CGREY, " Нет прав для использования этой команды");} 
     return 1; 
         }

Можно на Pawn.cmd

Share this post


Link to post

5 answers to this question

  • 0

@f0295655,

CMD:object(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, CGREY, " Нет прав для использования этой команды");
	
	new objectid, Float:angle;
	if(sscanf(params, "df", objectid, angle)) return SendClientMessage(playerid, CGREY, " /object [ID обьекта] [Угол поворота]");
	
	new Float:X, Float:Y,Float:Z,Float:rX,Float:rY; 
	GetPlayerPos(playerid, X, Y, Z); 
	SetPlayerPos(playerid,X,Y,Z +5); 
	CreateObject(objectid, X, Y, Z, rX, rY, angle);
	return 1;
}

 

Share this post


Link to post
  • 0

@odosenok 

C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(6) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(6) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(6) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(6) : warning 219: local variable "rX" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(6) : warning 219: local variable "rY" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(7) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(8) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(36) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(36) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(36) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(36) : warning 219: local variable "rX" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(36) : warning 219: local variable "rY" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(44) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(52) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(60) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(166) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(195) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(202) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(231) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixobject.inc(238) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixactor.inc(10) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixactor.inc(10) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\fixactor.inc(10) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\pawno\include\anticheat.inc(2405) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(2443) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(2443) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(2443) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(2465) : warning 219: local variable "angle" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(2490) : warning 219: local variable "angle" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(2515) : warning 219: local variable "angle" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(2731) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(2731) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(2731) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(11691) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(11691) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(11691) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(12845) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(12845) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(12845) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(12848) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(13371) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(13371) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(13371) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(14092) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(15135) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(15135) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(15135) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(15216) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(17848) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(17848) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(17848) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(17855) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(17855) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(17855) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(18078) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(18078) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(18078) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(18361) : warning 219: local variable "angle" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(18445) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(18445) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(18445) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(19170) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(19170) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(19170) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(19191) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(19191) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(19191) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(19734) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(19734) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(19734) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(36947) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(36947) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(36947) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(37189) : warning 219: local variable "objectid" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(38907) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(38907) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(38907) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(39849) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(39849) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(39849) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43662) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43662) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43662) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43781) : error 021: symbol already defined: "pc_cmd_object"
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43782) : warning 209: function "pc_cmd_object" should return a value
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43783) : error 010: invalid function or declaration
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43785) : error 021: symbol already defined: "GetPlayerPos"
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43786) : error 021: symbol already defined: "ac_SetPlayerPos"
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43786) : error 029: invalid expression, assumed zero
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43786) : error 021: symbol already defined: "fo_CreateObject"
C:\Users\Lenovo\Desktop\Новая Версия Enternity-RP-by Xean\gamemodes\ind1.pwn(43786 -- 43787) : fatal error 107: too many error messages on one line

Compilation aborted.

Pawn compiler 3.10.4              Copyright (c) 1997-2006, ITB CompuPhase


7 Errors.

https://imgur.com/Us43g4i Что-то не так

Share this post


Link to post
  • 0

@f0295655, нужно было просто скопировать и вставить. Не хватает одной скобки у вас.

Share this post


Link to post
  • 0

@odosenok 

C:\Users\Lenovo\Desktop\Íîâàÿ Âåðñèÿ Enternity-RP-by Xean\gamemodes\ind1.pwn(43782) : error 021: symbol already defined: "pc_cmd_object"
C:\Users\Lenovo\Desktop\Íîâàÿ Âåðñèÿ Enternity-RP-by Xean\gamemodes\ind1.pwn(43783) : error 017: undefined symbol "CGREY"
C:\Users\Lenovo\Desktop\Íîâàÿ Âåðñèÿ Enternity-RP-by Xean\gamemodes\ind1.pwn(43786) : error 017: undefined symbol "CGREY"
Pawn compiler 3.10.4              Copyright (c) 1997-2006, ITB CompuPhase

Как-то так

 

Share this post


Link to post
  • 0

@f0295655, ну, вместо CGREY впишите другой нужный вам цвет (можете пока что просто -1 написать, а дальше (при необходимости) заменить). И старую команду Object удалите.

Share this post


Link to post
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • tellarionterceiro
      By tellarionterceiro
      Привет, знает кто может быть как можно создать на карте гангзоны чёрного цвета?

      https://prnt.sc/fSq26C5kj2Xc