Skip to content
View in the app

A better way to browse. Learn more.

GTAGames.nl - De Nederlandse Grand Theft Auto Community!

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Cookie System

Hallo,

Ik heb dus een cookie system gedownload (Deze) en die heb ik wat verandert naar mijn smaak. Alleen, ik heb een probleempje. Ik heb dus geprobeert om een soort ''anti eat cookie spam'' te maken, maar dat schiet niet echt op. Het is met een Timer.

Dit is het stukje wat niet werkt:

dcmd_eatcookie(playerid, params[])
{
#pragma unused params
       if (forbidden[playerid] == 0)SendClientMessage(playerid,0xFF0000AA,"You cant eat cookies to fast! You need to wait for 3 minuts.");
else if (cookies[playerid] < 1)SendClientMessage(playerid,NICESKY,"You have not got any cookie. Try to get some cookies by being nice to admins!");
else
{
  	cookies[playerid]--;
new pn[MAX_PLAYER_NAME], connect[48];
GetPlayerName(strval(params), pn, sizeof(pn));
format(connect, sizeof(connect), "/cookies/%s.ini", pn );
dini_IntSet(connect, "cookies", cookies[playerid]);
new sendname[24],msg[128];
GetPlayerName(playerid,sendname,sizeof(sendname));
format(msg,sizeof(msg),"Cookie System: %s ate one of his cookies. He has now got %d cookies. Yum Yum!",sendname,cookies[playerid]);
       SendClientMessageToAll(NICESKY,msg);
new Float:cookiehealth;
GetPlayerHealth(playerid,cookiehealth);
SetPlayerHealth(playerid,cookiehealth+10);
SetTimer("anticookie",1800,false);

Public: voor de anti-spam

public anticookie(playerid)
{
forbidden[playerid] = 0;
SetTimer("eatcookie",0,false);
forbidden[playerid] = 1;
}

Het probleem is, als ik nu /eatcookie doe, dan staat er dat ik moet wachten (vanwegen de spam) Maar dat moet pas gebeuren nadat ik /eatcookie heb gedaan.

Kan iemand me helpen?

Alvast bedankt,

Penait1

Edited by penait1

Featured Replies

Je timer staat ook bij je command, daarom doet hij dat niet.

  • Author

Je timer staat ook bij je command, daarom doet hij dat niet.

Hij moet toch bij me commando? Anders activeert hij niet bij dat commando... :puh:?

Verplaats "forbidden[playerid = 0" eens boven "SetTimer("anticookie", 1800, false);" en verwijder "SetTimer("eatcookie", 0, false);". Misschien werkt dat.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.