28.06.2012, 14:06
[QUOTE=HellSphinX;1951993][PAWN]
// top
new LastSender[MAX_PLAYERS]; // a player global var to store the id of the last pm sender
// Under OnPlayerConnect, when they connect set it to -1 which means they didn't receiver any messages
LastSender[playerid] = -1;
// then put this into your pm command
LastSender[ID] = playerid; // means the last one who sent a pm to "ID" is "playerid"
// So now you can make a reply command .. /reply [message] and use the LastSender var to know
// who was the last player who sent this player a pm.
dcmd_reply(playerid, params[])
{
new ID = LastSender[playerid];
// also you can check if the var equals to -1 then return an error message.
if(ID == -1) return SendClientMessage(playerid, -1, "You didn't receiver any pms!");
/*
Your command stuff
*/
// And when your done formatting the message and everything send this message to ID
SendClientMessage(ID, -1, TheFormattedMessage);
return 1;
}
Here's the script 4166 - 4175
// top
new LastSender[MAX_PLAYERS]; // a player global var to store the id of the last pm sender
// Under OnPlayerConnect, when they connect set it to -1 which means they didn't receiver any messages
LastSender[playerid] = -1;
// then put this into your pm command
LastSender[ID] = playerid; // means the last one who sent a pm to "ID" is "playerid"
// So now you can make a reply command .. /reply [message] and use the LastSender var to know
// who was the last player who sent this player a pm.
dcmd_reply(playerid, params[])
{
new ID = LastSender[playerid];
// also you can check if the var equals to -1 then return an error message.
if(ID == -1) return SendClientMessage(playerid, -1, "You didn't receiver any pms!");
/*
Your command stuff
*/
// And when your done formatting the message and everything send this message to ID
SendClientMessage(ID, -1, TheFormattedMessage);
return 1;
}
PHP код:
C:\Users\sofie's\Desktop\CCNRRPG\gamemodes\SFCRRPG.pwn(4175) : error 017: undefined symbol "TheFormattedMessage"
C:\Users\sofie's\Desktop\CCNRRPG\gamemodes\SFCRRPG.pwn(4166) : warning 203: symbol is never used: "params"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
PHP код:
dcmd_r(playerid, params[])
{
new ID = LastSender[playerid];
// also you can check if the var equals to -1 then return an error message.
if(ID == -1) return SendClientMessage(playerid, -1, "You didn't receiver any pms!");
/*
Your command stuff
*/
// And when your done formatting the message and everything send this message to ID
SendClientMessage(ID, -1, TheFormattedMessage);
return 1;
}