24.02.2012, 19:16
well this /pm command is somehow bugged
Because When i type /pm it show this message
But when this line of the code is
But when i type fo example /pm 3 hi it doesn't do anything
how can i fix that problem so that it sends a pm also from rank 1 to 1338 admin and gamemasters also only no players to be able to send PM
Код:
if(strcmp(cmd, "/pm", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] == 0 || PlayerInfo[playerid][pGameMaster] >= 1)
{
SendClientMessage(playerid, COLOR_WHITE, " Ne ste Ovlasteni za Ovaa Komanda!.");
return 1;
}
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_WHITE, " Ne Ste Logirani!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /pm [ID/Ime Na Igrac] [text]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(PlayerInfo[playerid][pAdmin] == 1 || PlayerInfo[playerid][pGameMaster] >= 1)
{
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(HidePM[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " ");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /pm [ID/Ime Na Igrac] [text]");
return 1;
}
format(string, sizeof(string), "[ID:%d] %s pm you: %s", playerid, sendername, (result));
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Pm Sent [ID:%d]%s: %s", giveplayerid, giveplayer, (result));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
return 1;
}
}
else
{
format(string, sizeof(string), " %d Ne e Aktiven Igrac !.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}
return 1;
}
Quote:
|
"KORISTI: /pm [ID/Ime Na Igrac] [text]" |
Код:
if(PlayerInfo[playerid][pAdmin] == 0 || PlayerInfo[playerid][pGameMaster] >= 1)
how can i fix that problem so that it sends a pm also from rank 1 to 1338 admin and gamemasters also only no players to be able to send PM

