Problem with my OnPlayerText
#6

Quote:
Originally Posted by Romel
Посмотреть сообщение
Код:
warning 219: local variable "str" shadows a variable at a preceding level
there is already new str or global str somewhere delete it.

Код:
error 017: undefined symbol "string"
you have just copy this part are not you?

pawn Код:
GetPlayerName(playerid, name, sizeof(name));
    GetPlayerPos(playerid, X, Y, Z);
   
    format(string, sizeof(string), "[Local IC] %s (%d) : %s", name, playerid, text[0]);

    for(new i = 0; i < MAX_PLAYERS; ++i)
    {
        if(IsPlayerInRangeOfPoint(i, 5, X, Y, Z)) SendClientMessage(i, -1, string);
    }
change the following to fix the problem, You must make global str with size of 128 to make this work.

change this

pawn Код:
format(string, sizeof(string), "[Local IC] %s (%d) : %s", name, playerid, text[0]);
to this

pawn Код:
format(str, sizeof(str), "[Local IC] %s (%d) : %s", name, playerid, text[0]);
change this

pawn Код:
if(IsPlayerInRangeOfPoint(i, 5, X, Y, Z)) SendClientMessage(i, -1, string);
to this

pawn Код:
if(IsPlayerInRangeOfPoint(i, 5, X, Y, Z)) SendClientMessage(i, -1, str);
if global str with size of 128 or whatever is already created or made you don't need to create a new one with the same size and name.
That was actually my fault. I forgot to change "str" to "string" at the start.
Reply


Messages In This Thread
Problem with my OnPlayerText - by CrazyManiac - 10.08.2012, 14:09
Re: Problem with my OnPlayerText - by shitbird - 10.08.2012, 14:13
Re: Problem with my OnPlayerText - by CrazyManiac - 10.08.2012, 14:15
Re: Problem with my OnPlayerText - by shitbird - 10.08.2012, 14:17
Re: Problem with my OnPlayerText - by JaKe Elite - 10.08.2012, 14:21
Re: Problem with my OnPlayerText - by shitbird - 10.08.2012, 14:23

Forum Jump:


Users browsing this thread: 1 Guest(s)