04.02.2018, 05:50
And me again, with another bug.
Now there is PM bug on my server. When i tried to do /pm, it appears like this.
There is no names and the ID is weird. I tried to pm to myself (/pm 0 test)
Please help me fix it.
Here is the code
Now there is PM bug on my server. When i tried to do /pm, it appears like this.
There is no names and the ID is weird. I tried to pm to myself (/pm 0 test)
Please help me fix it.
Here is the code
PHP код:
CMD:pm(playerid, params[])
{
new string[256], giveplayerid, reason[128];
if(sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_GREY, "[USAGE] /pm [ID] [Message]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "That user is not connected!");
if(ToggleAllPM < 1)
{
if(togglepm[giveplayerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTGREENS, "[PM]{FFFFFF} Player tersebut menutup Player Messenger");
return 1;
}
format(string, sizeof(string), "(( PM from [%d] %s: %s ))", GetPlayerNameEx(playerid), playerid, reason);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
format(string, sizeof(string), "(( PM to [%d] %s: %s ))", GetPlayerNameEx(giveplayerid), giveplayerid, reason);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTGREENS, "[SERVER]{FFFFFF} System Player Messenger has been turned off.");
}
return 1;
}
CMD:togallpm(playerid, params[])
{
if(!gPlayerLogged{playerid}) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(AdminOnDuty[playerid] < 1) return SendClientMessage(playerid, COLOR_GREY, "{007FFF}[IZIN] {FFFFFF}You must be on duty administrator to use this command");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "{007FFF}[Izin] {FFFFFF}You are not authorized to use this command!");
if(ToggleAllPM == 0)
{
ToggleAllPM = 1;
SendClientMessageToAll(COLOR_LIGHTGREENS, "[SERVER]{FFFFFF} System Player Message has been turned to [OFF].");
}
else
{
ToggleAllPM = 0;
SendClientMessageToAll(COLOR_LIGHTGREENS, "[SERVER]{FFFFFF} System Player Message has been turned to [ON].");
}
return 1;
}
THE /togpm
PHP код:
CMD:togpm(playerid,params[])
{
if(togglepm[playerid] == 1)
{
SendClientMessage(playerid,0xff9900aa,"You have opened PM.");
togglepm[playerid] = 0;
}
else if(togglepm[playerid] == 0)
{
SendClientMessage(playerid,0xff9900aa,"You have closed PM.");
togglepm[playerid] = 1;
}
return 1;
}