04.11.2013, 12:26
Hello samp forum members thank you for reading my topic and code.
Maybe someone could help me out with it..
I can't find whats going wrong...
INI FILE:
OnGameModeInit:
Global checking:
CMD:
Maybe someone could help me out with it..
I can't find whats going wrong...
INI FILE:
pawn Код:
CMDT=1383562867
pawn Код:
SetTimer("GlobalCheck",1000,true);
pawn Код:
forward GlobalCheck();
public GlobalCheck()
{
foreach(Player,i)
{
if(PlayerInfo[i][pCMDT] > 0 && gettime() <= PlayerInfo[i][pCMDT])
{
PlayerInfo[i][pCMDT] = 0;
SendClientMessage(i,0xFFFFFFFF,"The /giverespect command is ready for use once more.");
}
}
return 1;
}
pawn Код:
CMD:giverespect(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pCMDT] > 0)return SendClientMessage(playerid,0xFF0000FF,"Please wait before using this command again.");
if(PlayerInfo[playerid][pCMDT] <= 0)
{
new id, string[128];
if(sscanf(params, "r", id)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /respect <playerid/partofname>");
if(IsPlayerInRangeOfPlayer(playerid, id, 5))
{
if(playerid != id)
{
PlayerInfo[playerid][pStreetRespect]++;
PlayerInfo[playerid][pCMDT] = gettime() + 3600;
if((gettime() - PlayerInfo[playerid][pCMDT]) > 3600)
format(string, sizeof(string), " You have gived Street Respect to %s.", NORPN(id));
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), " Player %s has gived you Street Respect to you.", NORPN(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
else
{
SendClientMessage(playerid, -1, "You can't heal yourself.");
}
}
else
{
SendClientMessage(playerid, -1, "You aren't close enough to the player.");
}
return 1;
}