How to do more except this?
#1

dcmd_login(playerid, params[])
{
new Name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, Name, sizeof(Name));

if(_LOGIN_LoggedIn[playerid] == 0)
{
if(!strlen(params) || strcmp(params, dini_Get("Players.ini", Name), true) != 0)
return SendClientMessage(playerid, COLOR_RED, "Invalid Password! Please Retry.");

SendClientMessage(playerid, COLOR_DARKGREEN, "Logged In.");

if(!strcmp(Name, "Eros"))
{
_LOGIN_Rank[playerid] = 2;
} else if (!strcmp(Name, "Decysen")) {
_LOGIN_Rank[playerid] = 3;
} else {
_LOGIN_Rank[playerid] = 1;
}

printf("%s (%d) Has Logged In. (Rank Set To: %d)", Name, playerid, _LOGIN_Rank[playerid]);

_LOGIN_LoggedIn[playerid] = 1;
} else {
SendClientMessage(playerid, COLOR_RED, "Already Logged In!");
}
return 1;
}

Ive made the part in bold. Somebody helped me made this a while ago, but used return. I do not only want to send a clientmessage but do more. How would i do this?

Thnx, Robbin
Reply
#2

Код:
SendClientMessage(playerid, COLOR_SHIT, "joosuk");
   return SendClientMessage(playerid, COLOR_RED, "Invalid Password! Please Retry.");
Reply
#3

if you wanna do more then just use brackets ( { } )

pawn Код:
dcmd_login(playerid, params[])
{
  new Name[MAX_PLAYER_NAME+1];
  GetPlayerName(playerid, Name, sizeof(Name));
 
  if(_LOGIN_LoggedIn[playerid] == 0)
  {
   if(!strlen(params) || strcmp(params, dini_Get("Players.ini", Name), true) != 0)
   {
   // here your stuff you wanna do if the password is wrong
   return SendClientMessage(playerid, COLOR_RED, "Invalid Password! Please Retry.");
   }
   
   SendClientMessage(playerid, COLOR_DARKGREEN, "Logged In.");
   
   if(!strcmp(Name, "Eros"))
   {
     _LOGIN_Rank[playerid] = 2;
   } else if (!strcmp(Name, "Decysen")) {
     _LOGIN_Rank[playerid] = 3;
   } else {
      _LOGIN_Rank[playerid] = 1;
   }
   
    printf("%s (%d) Has Logged In. (Rank Set To: %d)", Name, playerid, _LOGIN_Rank[playerid]);
   
    _LOGIN_LoggedIn[playerid] = 1;
  } else {
    SendClientMessage(playerid, COLOR_RED, "Already Logged In!");
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)