13.10.2018, 17:44
In gamemode:
cmdHandler.pwn
s.pwn
PHP код:
#include <a_samp>
#include <sscanf2>
#include <strlib>
#include <YSI\y_hooks>
#include <a_mysql>
#include <Pawn.RakNet>
#include <Pawn.CMD>
#include <SHA256>
#include <DialogCenter>
#include <geolocation>
#include <YSI\y_iterate>
#include "includes/main/definitions.pwn"
#include "includes/main/globalVars.pwn"
#include "includes/main/enums.pwn"
#include "includes/main/timers.pwn"
#include "includes/main/customFuncs.pwn"
#include "includes/main/dbConnection.pwn"
#include "includes/users/--.pwn"
#include "includes/users/--.pwn"
#include "includes/users/--.pwn"
#include "includes/users/--.pwn"
#include "includes/users/--.pwn"
#include "includes/characters/--.pwn"
#include "includes/characters/--.pwn"
#include "includes/characters/--.pwn"
#include "cmdHandler.pwn" // <-- there are cmds that are includes
PHP код:
forward OnPlayerCommandReceived(playerid, cmd[], params[], flags);
public OnPlayerCommandReceived(playerid, cmd[], params[], flags)
{
if(users[playerid][uStatus] == 0 || characters[playerid][cStatus] == 0)
{
return 0;
}
if(lastCommandTime[playerid] > gettime())
{
return 0;
}
else
{
lastCommandTime[playerid] = gettime()+1;
return 1;
}
}
// characters
#include "includes/characters/cmds/sv.pwn"
#include "includes/characters/cmds/s.pwn"
PHP код:
CMD:s(playerid, params[])
{
new text[128];
if(sscanf(params, "s[128]", text))
{
return SendClientMessage(playerid, -1, "{d9d9d9}[{00cc66}Use{d9d9d9}]: /s message");
}
else
{
_sendLocalScream(playerid, text);
return 1;
}
}
PHP код:
CMD:sv(playerid, params[])
{
if(characters[playerid][cLastSave] > gettime())
{
new message[256];
new minutes = (characters[playerid][cLastSave]-gettime())/MINUTE;
new seconds = (characters[playerid][cLastSave]-gettime())%MINUTE;
// some calculations, format
return SendClientMessage(playerid, -1, message);
}
else
{
characters[playerid][cLastSave] = gettime()+(MINUTE*10);
saveCharacterData(playerid);
return SendClientMessage(playerid, -1, "DEBUG EXIT");
}
}