SA-MP Forums Archive
Error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error (/showthread.php?tid=399321)



Error - Fernado Samuel - 13.12.2012

Removed


Re: Error - LarzI - 13.12.2012

How do you declare and assign pName?


Re: Error - Fernado Samuel - 13.12.2012

Removed


Re: Error - LarzI - 13.12.2012

I suspect the PropOwner declaration is faulty.
In the enum you use with PropInfo, add [24] after PropOwner - if you haven't already.


Re: Error - Jefff - 13.12.2012

pawn Код:
strcat( ( PropInfo[ID][PropOwner][0]='\0', PropInfo[ID][PropOwner] ), pName, sizeof(pName));
or

pawn Код:
GetPlayerName(playerid,PropInfo[ID][PropOwner],MAX_PLAYER_NAME);
EDIT:
Ups fail ;d do what LarzI say


Re: Error - maramizo - 13.12.2012

Quote:
Originally Posted by LarzI
Посмотреть сообщение
I suspect the PropOwner declaration is faulty.
In the enum you use with PropInfo, add [24] after PropOwner - if you haven't already.
Add [MAX_PLAYER_NAME] instead of [24] after PropOwner, as OP might have #undef and #define'd it to something else, or the script he's working on has. Just as a precaution and a dynamic scripting measure.


Re: Error - LarzI - 14.12.2012

Quote:
Originally Posted by maramizo
Посмотреть сообщение
Add [MAX_PLAYER_NAME] instead of [24] after PropOwner, as OP might have #undef and #define'd it to something else, or the script he's working on has. Just as a precaution and a dynamic scripting measure.
MAX_PLAYER_NAME is defined as a macro to 24 - and 24 is the longest a player name can be. There's no difference if he uses MAX_PLAYER_NAME or 24 UNLESS he did, as you said, #undef and re-define it to something else - something I find highly unlikely.


Re: Error - maramizo - 14.12.2012

Quote:
Originally Posted by LarzI
Посмотреть сообщение
MAX_PLAYER_NAME is defined as a macro to 24 - and 24 is the longest a player name can be. There's no difference if he uses MAX_PLAYER_NAME or 24 UNLESS he did, as you said, #undef and re-define it to something else - something I find highly unlikely.
I'm not arguing about what's best, it's an obvious fact.
He can undefine it then define to 15, then we have 9 wasted character spots, why? It's best if it's dynamic, correct?


Re: Error - LarzI - 14.12.2012

Quote:
Originally Posted by maramizo
Посмотреть сообщение
I'm not arguing about what's best, it's an obvious fact.
He can undefine it then define to 15, then we have 9 wasted character spots, why? It's best if it's dynamic, correct?
Yes of course, but unless he never intends to re-define the macro, he would waste time typing in MAX_PLAYER_NAME every time (which takes ~4 seconds) instead of doing just 24 (which takes ~0.3 second). It's all about time efficiency!


Re: Error - Fernado Samuel - 14.12.2012

Thank you guys