2 small questions -
Lisaax - 21.03.2014
When i use /duel it said you need to be logged in first!
How to fix that? I am logged in?
2nd.:
I have a general chat /toggc ( like HZRP )
how can it be like instead of level 99999 admin Lisa : hey
to
Server Owner Lisa:hey
Also with this:
level 1/2/3/4/1337/9998 admin:hey
Junior/general/senior/head admin etc etc: hey
Re: 2 small questions -
Carxi - 21.03.2014
Can you post your code about /duel?
Re: 2 small questions -
Lisaax - 23.03.2014
Код:
CMD:duel(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /duel [playerid]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(EventOn) return SendClientMessage(playerid, COLOR_GREY, "There's a event happening, you cant duel now.");
if(DuelOn) return SendClientMessage(playerid, COLOR_GREY, "There is already an duel happening.");
PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
PlayerInfo[playerid][pVW] = GetPlayerVirtualWorld(playerid);
format(string, sizeof(string), "AdmWarn: %s has started an duel with %s.", RPN(playerid), RPN(playerb));
SendAdminMessage(COLOR_LIGHTRED, string);
SendClientMessage(playerid, COLOR_BLUE, "You are duelling..");
SendClientMessage(playerb, COLOR_BLUE, "You are duelling..");
GetPlayerPos(playerid, eX, eY, eZ);
GetPlayerHealth(playerid, eHP);
GetPlayerArmour(playerid, eARMOR);
for(new i=0; i<13; i++)
{
GetPlayerWeaponData(playerid, i, PlayerInfo[playerid][pWeapon][i], PlayerInfo[playerid][pWeaponAmmo][i]);
}
GunsBeingRemoved[playerid] = 1;
DuelOn = 1;
Duel[playerid] = 1;
Duel[playerb] = 1;
ResetPlayerWeapons(playerid);
/* break */
PlayerInfo[playerb][pInt] = GetPlayerInterior(playerb);
PlayerInfo[playerb][pVW] = GetPlayerVirtualWorld(playerb);
GetPlayerPos(playerb, eX, eY, eZ);
GetPlayerHealth(playerb, eHP);
GetPlayerArmour(playerb, eARMOR);
for(new i=0; i<13; i++)
{
GetPlayerWeaponData(playerb, i, PlayerInfo[playerb][pWeapon][i], PlayerInfo[playerb][pWeaponAmmo][i]);
}
GunsBeingRemoved[playerb] = 1;
ResetPlayerWeapons(playerb);
SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
GiveDodWeapon(playerid, 24, 200);
GiveDodWeapon(playerb, 24, 200);
TogglePlayerControllable(playerb, 0);
TogglePlayerControllable(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerb, 100);
SetPlayerArmour(playerb, 100);
SetTimerEx("EnterExitTimer", 5000, false, "i", playerb);
SetPlayerPos(playerb, -257.6650,-862.7711,1188.3394);
SetPlayerPos(playerid, -276.1044,-846.8372,1188.3394);
SetPlayerVirtualWorld(playerid, 50);
SetPlayerVirtualWorld(playerb, 50);
SetPlayerInterior(playerb, 3);
SetPlayerInterior(playerid, 3);
return 1;
}
stock isplayerloggedin:
Код:
stock IsPlayerLoggedIn(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLoggedIn])
{
return 1;
}
}
return 0;
}
Re: 2 small questions -
MythicalMarauder - 23.03.2014
About your second question, you need to edit the OnPlayerText
An example:
pawn Код:
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name);
if(pInfo[playerid][pAdmin] == 5) // max level? | change to your enums, sadly I cannot guess them.
{
format(string, sizeof(string), "[OWNER]: %s(%d): %s", name, playerid, text[0]);
SendClientMessageToAll(white, string);
return 0; // stops the original text from being sent.
}
Re: 2 small questions -
Lisaax - 23.03.2014
Not add that at the cmd? /G ? Cause i got this:
Код:
CMD:g(playerid, params[])
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
return 1;
}
if(PlayerInfo[playerid][pGCMuted] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "You're muted from this channel.");
return 1;
}
new string[128];
if(GlobalChatTimer[playerid] > 0)
{
format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", GlobalChatTimer[playerid]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
if(GlobalChat[playerid] == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "You're not in the global chat, type /toggc.");
return 1;
}
if(isnull(params))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/g) [text]");
if(strlen(params) > 80)
return SendClientMessage(playerid, COLOR_GREY, "Your message is too long - the limit is 80 characters.");
if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDonator] == 1)
{
format(string, sizeof(string), "(( Ruby Donator %s: %s ))", GetPlayerNameEx(playerid), params);
GlobalChatTimer[playerid] = 5;
}
else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDonator] == 2)
{
format(string, sizeof(string), "(( Sapphire Donator %s: %s ))", GetPlayerNameEx(playerid), params);
GlobalChatTimer[playerid] = 5;
}
else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDonator] == 3)
{
format(string, sizeof(string), "(( Diamond Donator %s: %s ))", GetPlayerNameEx(playerid), params);
GlobalChatTimer[playerid] = 5;
}
else if(PlayerInfo[playerid][pHelper] == 1)
{
format(string, sizeof(string), "(( Junior Helper %s: %s ))", GetPlayerNameEx(playerid), params);
GlobalChatTimer[playerid] = 2;
}
else if(PlayerInfo[playerid][pHelper] == 2)
{
format(string, sizeof(string), "(( Senior Helper %s: %s ))", GetPlayerNameEx(playerid), params);
GlobalChatTimer[playerid] = 2;
}
else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDonator] == 1)
{
format(string, sizeof(string), "(( Level %d Player %s: %s ))", PlayerInfo[playerid][pLevel], GetPlayerNameEx(playerid), params);
GlobalChatTimer[playerid] = 5;
}
else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDonator] == 0)
{
format(string, sizeof(string), "(( Level %d Player %s: %s ))", PlayerInfo[playerid][pLevel], GetPlayerNameEx(playerid), params);
GlobalChatTimer[playerid] = 5;
}
else if(PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "(( Level %d Admin %s: %s ))", PlayerInfo[playerid][pAdmin], GetPlayerNameEx(playerid), params);
}
foreach(Player, i)
{
if(GlobalChat[i] == 1)
{
SendClientMessage(i, COLOR_NEWS, string);
}
}
return 1;
}
Re: 2 small questions -
MythicalMarauder - 23.03.2014
You can add that wherever you want, but change text[0] to params.
Also change your enums (admin levels, vip.. etc).
Re: 2 small questions -
Lisaax - 23.03.2014
Nvm, i dont understand it, and its hard. Forget question 2. Only question 1.
Re: 2 small questions -
Lisaax - 23.03.2014
BUMP, need help with You are not logged in error, Question 1
Re: 2 small questions -
Lisaax - 24.03.2014
BUMP, how can i fix if im using /duel im just can use it ? Its now saying you are not logged in.
Re: 2 small questions -
newbie scripter - 24.03.2014
pawn Код:
stock IsPlayerLoggedIn(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLoggedIn])
{
return 1;
}
else return 0;
}
}
Try it, donno if it works, havent scripted for months