SA-MP Forums Archive
I got a simple problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I got a simple problem (/showthread.php?tid=449169)



I got a simple problem - fuem1907 - 07.07.2013

Hi.

I got a command ony my script.
People using this code like /getgift.
When They use this command, They shouldn't use it again.

I mean

First try : /getgift

Blabla bla.

Second try: /getgift

"You can't use this command again."

Can you make it ? Thanks .


Re: I got a simple problem - Red_Dragon. - 07.07.2013

I guess you can make a variable which checks if the player received the gift in the last 7 hours.


Re: I got a simple problem - josephtky - 07.07.2013

I think it is because of every players get a gift every 5 hours. (depend on your script) if not try check your script.


Re: I got a simple problem - [MG]Dimi - 07.07.2013

pawn Код:
#include <a_samp>

new bool:Gift[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    Gift[playerid] = false;
    return 1;
}

public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/gift",true))
    {
        if(Gift[playerid] == true) return SendClientMessage(playerid,0xFF0000FF,"You can't take another gift!");
        Gift[playerid] = true;
        //code to give gift goes here
        return 1;
    }
    return 0;
}