GetPVarString And Strcmp problems
#1

Hey everyone,

I was messing with this code for hours now and I still could not figure out what's wrong.

Here's the code:

pawn Код:
else if(LocationStatus[i] == 2)
                {
                  GetPVarString(i,"lastlocation",lastloc,sizeof(lastloc));
                  if(!strlen(lastloc))
                  {
                    format(lastloc, sizeof(lastloc), "%s", zone);
                    SendAllMsg(RED, "lastloc did not contain anything - set to: '%s'", lastloc);
                  }
                  SendAllMsg(RED, "Getting string into lastloc from lastlocation - output: '%s'", lastloc);
                  format(oldloc, sizeof(oldloc), "%s", lastloc);
                  if(strcmp(oldloc, zone, true))
                  {
                    GameTextForPlayer(i, zone, 1000, 1);
                    SendAllMsg(RED, "location names are different - oldloc: '%s' new loc: '%s'", lastloc, zone);
                    }
                }
Problem: As you can see I added debug lines to see how stuffs get called. When I'm using this code, the only message I get is SendAllMsg(RED, "Getting string into lastloc from lastlocation - output: '%s'", lastloc); and nothing else. Also, the gametext does not show up. I tried changing strcmp to == 0 but it did not work either.
Please help me!

Thanks,
bpeterson
Reply


Messages In This Thread
GetPVarString And Strcmp problems - by bpeterson - 07.05.2010, 20:27
Re: GetPVarString And Strcmp problems - by dice7 - 07.05.2010, 20:38
Re: GetPVarString And Strcmp problems - by bpeterson - 08.05.2010, 13:22
Re: GetPVarString And Strcmp problems - by Jefff - 08.05.2010, 13:25
Re: GetPVarString And Strcmp problems - by bpeterson - 08.05.2010, 13:31
Re: GetPVarString And Strcmp problems - by bpeterson - 08.05.2010, 14:27
Re: GetPVarString And Strcmp problems - by dice7 - 09.05.2010, 11:04
Re: GetPVarString And Strcmp problems - by Jefff - 09.05.2010, 12:13
Re: GetPVarString And Strcmp problems - by bpeterson - 10.05.2010, 11:44

Forum Jump:


Users browsing this thread: 1 Guest(s)