OFFSprings
Участник
- Сообщения
- 14
- Реакции
- 0
Имею хорошие навыки программирования на C++, хотел попробовать перейти на Pawn, очень сильно обрадовался,когда увидел methodmap, до этого примитивные плагины писал,сложности при освоении особо нет, но какие то не логичные ошибки, может здесть не такой принцип программирования, ибо на официальном сайте читал, вроде бы делаю все правильно
Ошибки
plugin.sp(26) : error 001: expected token: "(", but found ";"
plugin.sp(34) : error 001: expected token: "(", but found "."
plugin.sp(34) : warning 215: expression has no effect
plugin.sp(35) : error 001: expected token: "(", but found "."
plugin.sp(35) : warning 215: expression has no effect
plugin.sp(36) : error 001: expected token: "(", but found "."
plugin.sp(36) : warning 215: expression has no effect
plugin.sp(50) : error 171: cannot use 'new' with non-object-like methodmap 'CBasePlayer'
plugin.sp(50) : warning 213: tag mismatch
plugin.sp(50) : warning 204: symbol is assigned a value that is never used: "pBasePlayer"
plugin.sp(50 -- 51) : warning 203: symbol is never used: "GetPlayer"
5 Errors.
PHP:
methodmap CPointF
{
property float x
property float y
property float z
}
methodmap CBasePlayer//Нравится название
{
property int userId
property CPointF m_pos
//Не очень нравится писать set() и get()
//property char[] m_playername я так понял что массивы как свойство использовать нельзя
public CBasePlayer(int _userId)
{
this.userId=_userId;
this.m_pos.x=0;
this.m_pos.y=0;
this.m_pos.z=0;
}
public CPointF GetPosition()
{
/*26*/ return this.m_pos; //Ставил скобки не помогло
}
/*public ~CBasePlayer() пишет что пользовательский деструктор больше не поддерживается
{
}*/
public void SetPos(float x,float y,float z)
{
/*34*/ this.m_pos.x=x;
/*35*/ this.m_pos.y=y;
/*36*/ this.m_pos.z=z;
}
};
CBasePlayer GetPlayer()//Обычный пример
{
return new CBasePlayer(3); //главное на это не ругается
}
public void OnPluginStart()
{
/*48*/ CBasePlayer m_basePlayer=new CBasePlayer(3);// на это ругается
}
Ошибки
plugin.sp(26) : error 001: expected token: "(", but found ";"
plugin.sp(34) : error 001: expected token: "(", but found "."
plugin.sp(34) : warning 215: expression has no effect
plugin.sp(35) : error 001: expected token: "(", but found "."
plugin.sp(35) : warning 215: expression has no effect
plugin.sp(36) : error 001: expected token: "(", but found "."
plugin.sp(36) : warning 215: expression has no effect
plugin.sp(50) : error 171: cannot use 'new' with non-object-like methodmap 'CBasePlayer'
plugin.sp(50) : warning 213: tag mismatch
plugin.sp(50) : warning 204: symbol is assigned a value that is never used: "pBasePlayer"
plugin.sp(50 -- 51) : warning 203: symbol is never used: "GetPlayer"
5 Errors.