Unwanted Message Showing
#1

Hey hey!... [SAP]Sidhu here. I'm currently scripting a new Gamemode... I'm giving admins their own houses and vehicles as a special. When the player types the command to teleport to their house, it says "Welcome to your house [player's name]". It's supposed to say that. When I added more houses and vehicles, and people used the teleport command, this started coming up:

"Welcome to your house [player's name]"
"You don't own a house"
"You don't own a house"
"You don't own a house"

The "You don't own a house" message comes up one more time when another player's property is added.

Can anybody help me fix this problem?

Thanks.

Code Here: http://pastebin.com/m603f16f8

* Just thought about it... Am I supposed to add a return 1; after the player's tele info?

Reply
#2

Return 1 after every teleport to a house
Reply
#3

Quote:
Originally Posted by JeNkStAX
Return 1 after every teleport to a house
Do I have to put:

pawn Code:
new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    if(strcmp(PlayerName, "[SAP]Sidhu", true) == 0)
        {
            SetPlayerPos(playerid,1256.8922,-785.2639,92.0302);
            SetPlayerFacingAngle(playerid,268.8916);
            SendClientMessage (playerid, green, "Welcome Home, [SAP]Sidhu!");
            }
            else
            {
          SendClientMessage(playerid, red, "You do not own a house!");
            }
For every person?
Reply
#4

Do
pawn Code:
new PlayerName[MAX_PLAYER_NAME];
 GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  if(strcmp(PlayerName, "[SAP]Sidhu", true) == 0)
{
SetPlayerPos(playerid,1256.8922,-785.2639,92.0302);
SetPlayerFacingAngle(playerid,268.8916);
SendClientMessage (playerid, green, "Welcome Home, [SAP]Sidhu!");
return 1;
}
else
{
  SendClientMessage(playerid, red, "You do not own a house!");
  return 1;
}
for every house
Reply
#5

Ok

Thanks man!

EDIT: I put that for every person, but I get the following

C:\Users\Sidhu\Desktop\AdminHouses.pwn(246) : error 021: symbol already defined: "PlayerName"
C:\Users\Sidhu\Desktop\AdminHouses.pwn(259) : error 021: symbol already defined: "PlayerName"
C:\Users\Sidhu\Desktop\AdminHouses.pwn(272) : error 021: symbol already defined: "PlayerName"
C:\Users\Sidhu\Desktop\AdminHouses.pwn(285) : error 021: symbol already defined: "PlayerName"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

Quote:
Originally Posted by [SAP
Sidhu ]
Ok

Thanks man!

EDIT: I put that for every person, but I get the following

C:\Users\Sidhu\Desktop\AdminHouses.pwn(246) : error 021: symbol already defined: "PlayerName"
C:\Users\Sidhu\Desktop\AdminHouses.pwn(259) : error 021: symbol already defined: "PlayerName"
C:\Users\Sidhu\Desktop\AdminHouses.pwn(272) : error 021: symbol already defined: "PlayerName"
C:\Users\Sidhu\Desktop\AdminHouses.pwn(285) : error 021: symbol already defined: "PlayerName"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Remove that
new PlayerName[MAX_PLAYER_NAME];
Reply
#7

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by [SAP
Sidhu ]
Ok

Thanks man!

EDIT: I put that for every person, but I get the following

C:\Users\Sidhu\Desktop\AdminHouses.pwn(246) : error 021: symbol already defined: "PlayerName"
C:\Users\Sidhu\Desktop\AdminHouses.pwn(259) : error 021: symbol already defined: "PlayerName"
C:\Users\Sidhu\Desktop\AdminHouses.pwn(272) : error 021: symbol already defined: "PlayerName"
C:\Users\Sidhu\Desktop\AdminHouses.pwn(285) : error 021: symbol already defined: "PlayerName"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Remove that
new PlayerName[MAX_PLAYER_NAME];
Remove what?
Reply
#8

I've done what people told me to do before.. Now I've added one more person to this script, and its gone bonkers!
Can someone please help me fix it?

http://pastebin.com/m21d1e1f5

Thanks.
Reply
#9

http://pastebin.com/f1f7ea401
There you go, compiled fine. No errors/warnings.

Tip: Tab it correctly from now on please, it makes it a whole lot easier for a lot of people like me to read.

Hope it works
Reply
#10

Quote:
Originally Posted by tom_jonez
http://pastebin.com/f1f7ea401
There you go, compiled fine. No errors/warnings.

Tip: Tab it correctly from now on please, it makes it a whole lot easier for a lot of people like me to read.

Hope it works
Hey!
Thanks for replying.. And I actually did indent it ( paste bin screwed it up )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)