if(strcmp(cmd, "/granades", true) == 0) { if (PlayerInfo[playerid][pDonateRank] >= 3) { GivePlayerGun(playerid, 16); GivePlayerMoney(playerid, -50000); SendClientMessage(playerid, COLOR_GRAD1,"Ти закупи 10 гранати за 50,000$!"); } else { SendClientMessage(playerid, COLOR_GRAD1,"ERROR: Ти не си вип или нямаш нужните права,за да използваш командата!"); } return 1; }
if(strcmp("/afk", cmdtext, true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "Сега си AFK, напиши /back за да се върнеш отново!"); TogglePlayerControllable(playerid,0); label[playerid] = Create3DTextLabel("AFK",yellow,30.0,40.0,50.0,40.0,0); Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7); SetPlayerVirtualWorld(playerid, 28); new string3[70]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string3, sizeof(string3), "%s отиде AFK!", name); SendClientMessageToAll(COLOR_YELLOW, string3); return 1; } if(strcmp("/back", cmdtext, true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "Ти се завърна!"); TogglePlayerControllable(playerid,1); SetPlayerVirtualWorld(playerid, 0); new string3[70]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string3, sizeof(string3), "%s се завърна!", name); SendClientMessageToAll(COLOR_YELLOW, string3); Delete3DTextLabel(Text3D:label[playerid]); return 1; }
// On top (with all of other forwards)
forward DonatorGranadeTimer(playerid);
// On top (with all your variables)
new granadesgiven[MAX_PLAYERS];
// Now we have to start the timer when he typed that command so
if(strcmp(cmd, "/granades", true) == 0)
{
if (PlayerInfo[playerid][pDonateRank] >= 3)
{
if(granadesgiven[playerid] == 0)
{
GivePlayerGun(playerid, 16);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_GRAD1,"Oe зaeуie 10 a?aнaoe зa 50,000$!");
SetTimerEx("DonatorGranadeTimer", 60000, 0, "i", playerid); // 60000 = 60 seconds = 1 minute
granadesgiven[playerid] = 1;
}
else if(granadesgiven[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD1,"Plase wait 1 minute");
}
}
return 1;
}
// Now we need to set up a public for that timer
public DonatorGranadeTimer(playerid)
{
granadesgiven[playerid] = 0;
return 1;
}
its : https://sampwiki.blast.hk/wiki/SetTimerEx, i made an example, I'm not sure if it works but :
pawn Код:
|
C:\Users\ники\Desktop\gangwars.pwn(3514 -- 3519) : error 017: undefined symbol "PlayerName" C:\Users\ники\Desktop\gangwars.pwn(3530) : error 017: undefined symbol "PlayerName" C:\Users\ники\Desktop\gangwars.pwn(3700) : error 017: undefined symbol "ResetVars" C:\Users\ники\Desktop\gangwars.pwn(4793) : error 017: undefined symbol "AntiDeAMX" C:\Users\ники\Desktop\gangwars.pwn(4799) : error 004: function "FixHour" is not implemented C:\Users\ники\Desktop\gangwars.pwn(4818) : error 004: function "FixHour" is not implemented C:\Users\ники\Desktop\gangwars.pwn(4822) : error 017: undefined symbol "LoadFactions" C:\Users\ники\Desktop\gangwars.pwn(5426) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(5440) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(5482) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(5502) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(5511) : error 017: undefined symbol "GivePlayerCash" C:\Users\ники\Desktop\gangwars.pwn(5537) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(5579) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(5596) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(5602) : error 017: undefined symbol "GivePlayerCash" C:\Users\ники\Desktop\gangwars.pwn(5625) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(5631) : error 017: undefined symbol "GivePlayerCash" C:\Users\ники\Desktop\gangwars.pwn(5644) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(5673) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(5682) : error 017: undefined symbol "GivePlayerCash" C:\Users\ники\Desktop\gangwars.pwn(5695) : error 004: function "TimeTextForPlayer" is not implemented C:\Users\ники\Desktop\gangwars.pwn(6154) : error 017: undefined symbol "PlayerName" C:\Users\ники\Desktop\gangwars.pwn(6175) : error 017: undefined symbol "ResetVars" C:\Users\ники\Desktop\gangwars.pwn(6248) : error 004: function "SaveAccounts" is not implemented C:\Users\ники\Desktop\gangwars.pwn(6275) : error 004: function "SaveAccounts" is not implemented Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 26 Errors.
if(strcmp(cmd, "/granades", true) == 0)
{
if (PlayerInfo[playerid][pDonateRank] >= 3)
{
if(granadesgiven[playerid] == 0)
{
GivePlayerGun(playerid, 16);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_GRAD1,"Oe зaeуie 10 a?aнaoe зa 50,000$!");
SetTimerEx("DonatorGranadeTimer", 60000, 0, "i", playerid); // 60000 = 60 seconds = 1 minute
granadesgiven[playerid] = 1;
}
else if(granadesgiven[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD1,"Plase wait 1 minute");
}
}
return 1;
}
if(strcmp("/afk", cmdtext, true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "Сега си AFK, напиши /back за да се върнеш отново!"); TogglePlayerControllable(playerid,0); label[playerid] = Create3DTextLabel("AFK",yellow,30.0,40.0,50.0,40.0,0); Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7); SetPlayerVirtualWorld(playerid, 28); new string3[70]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string3, sizeof(string3), "%s отиде AFK!", name); SendClientMessageToAll(COLOR_YELLOW, string3); return 1; } if(strcmp("/back", cmdtext, true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "Ти се завърна!"); TogglePlayerControllable(playerid,1); SetPlayerVirtualWorld(playerid, 0); new string3[70]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string3, sizeof(string3), "%s се завърна!", name); SendClientMessageToAll(COLOR_YELLOW, string3); Delete3DTextLabel(Text3D:label[playerid]); return 1; }