Please HELP!!!
#1

Код:
new var=gettime() - LastUsed[playerid];
pawn Код:
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(389) : error 017: undefined symbol "LastUsed"
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(389) : warning 215: expression has no effect
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(389) : error 001: expected token: ";", but found "]"
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(389) : error 029: invalid expression, assumed zero
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(389) : fatal error 107: too many error messages on one line
Reply
#2

pawn Код:
new LastUsed[MAX_PLAYERS];
Reply
#3

C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(390) : error 017: undefined symbol "var"
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(397) : warning 225: unreachable code
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(397) : error 029: invalid expression, assumed zero
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(397) : error 017: undefined symbol "HasFullHealth"
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(406) : warning 225: unreachable code
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(406) : error 029: invalid expression, assumed zero
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(406) : error 017: undefined symbol "cmd_ls"
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(406) : error 029: invalid expression, assumed zero
C:\Users\NINA\Desktop\LSGW\gamemodes\LSGW.pwn(406) : fatal error 107: too many error messages on one line
Reply
#4

someone!?!
Reply
#5

pawn Код:
// On top of your gamemode:
new LastUsed[MAX_PLAYERS];

// Inside your command:
LastUsed[playerid] = gettime(); // Store a unix timestamp in the variable.
if((gettime() - LastUsed[playerid] < 60) // Check if the command was used recently (60 seconds of delay).
Reply
#6

Where do i put all dis?
Reply
#7

Just read this:

https://sampforum.blast.hk/showthread.php?tid=254915
Reply
#8

like this ?
pawn Код:
CMD:hp(playerid,params[])
{
LastUsed[playerid] = gettime(); // Store a unix timestamp in the variable.
if((gettime() - LastUsed[playerid] < 60)
if(var<=(60*3))return SendClientMessage(playerid,-1,"{ff0000}ERROR: You can't use this command right now.");
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -1600);
LastUsed[playerid]=gettime();
return SendClientMessage(playerid,-1,"{00cc00}You have been healed !");


stock HasFullHealth(playerid)
{
    static Float:asdHealth;
    GetPlayerHealth(playerid, asdHealth);
    if(asdHealth >= 99) return true;
    else if(asdHealth < 99 && asdHealth != 99) return false;
    return 1;
}
Reply
#9

pawn Код:
CMD:hp(playerid,params[])
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    if((gettime() - LastUsed[playerid] < 60)) return SendClientMessage(playerid, 0xff0000FF, "ERROR: You can't use this command right now.");
    if(health == 100) return SendClientMessage(playerid, 0xff0000FF, "ERROR: Your health is already full.");
    SetPlayerHealth(playerid, 100);
    GivePlayerMoney(playerid, -1600);
    SendClientMessage(playerid, 0x00cc00FF, "You have been healed!");
    LastUsed[playerid] = gettime();
    return 1;
}
Reply
#10

C:\Users\ScoK\Desktop\LSGW\gamemodes\LSGW.pwn(392) : error 001: expected token: ")", but found "return"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)