Confused about code
#1

The problem is when i have used my command to set the HouseClosed[playerid] to 0.
I want it to be like this: Only eros can enter the house, and the rest will get the message that the house is closed. The problem: Everyone can still enter when the house is closed, can somebody help me?

Im actually a little bit confused about my own code.
Also the HouseClosed[ID] must be eros's house. Dont get it how

This gets called when a player enters the checkpoint to enter the house:

pawn Код:
new Name[MAX_PLAYER_NAME+1];
new ID;

for(new i=0; i<MAX_PLAYERS; i++)
{
  if(IsPlayerConnected(i)) {
    GetPlayerName(i, Name, sizeof(Name));
    ID = GetPlayerID(Name);

    if(strcmp(Name, "Eros")) {
      if(HouseClosed[ID] == 1) return SendClientMessage(playerid, COLOR_RED, "This House Is Currently Closed To Visitors.");
    }
  }
}
Thnx!!!
Reply
#2

Код:
if(strcmp(Name, "Eros",true)==0) {
? xd
Reply
#3

Im still confused about the whole thing (The strcmp part)
If its not eros, it should get the house is not open message, else he must be able to enter.

Damn :S
Reply
#4

strcmp gives 0 when it's an exact match
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)