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.

Pname (help)

Hoi, ik heb zelf een beetje een Afk en Back systeem proberen te maken. Maar ik zit met 1 ding klem. Ik wil als iemand "/afk" typt dat dan alle spelers te zien krijgen: [spelernaam] Is now Afk. (/Afk)

Ik heb dit gedaan:

GetPlayerName(playerid, pname,Sizeof,(pname)); SendClientMessageToAll(COLOR_RED, "is now Afk. (Afk");

Maar ik krijg deze error :S

error 017: undefined symbol "pname"

Hoe kan ik dit verhelpen? En ik heb al in het lijstje gekken om error codes te verhelpen, maar daar kwam ik niet veel wijzer uit...

Featured Replies

Je hebt geen variabele gemaakt om de naam in op te slaan.

Als je de naam eenmaal hebt, zal die ook niet uit zichzelf tevoorschijn komen. De format functie wordt gebruikt om variabelen in een string te zetten.

new
   pname[24], 
   string[128];

GetPlayerName(playerid, pname, sizeof(pname))
format(string, sizeof(string), "%s is now AFK.", pname);
SendClientMessageToAll(COLOR_RED, string);

  • Author

Je hebt geen variabele gemaakt om de naam in op te slaan.

Als je de naam eenmaal hebt, zal die ook niet uit zichzelf tevoorschijn komen. De format functie wordt gebruikt om variabelen in een string te zetten.

new
   pname[24], 
   string[128];

GetPlayerName(playerid, pname, sizeof(pname))
format(string, sizeof(string), "%s is now AFK.", pname);
SendClientMessageToAll(COLOR_RED, string);

Ok! Hartstikke bedankt! Het is gelukt :) Maar, ik wil ook nog zegmaar als je /Afk doet dat er dan boven je hoofd verschijnt: This player is Afk.

Hoe kan ik dat doen?

Je hebt geen variabele gemaakt om de naam in op te slaan.

Als je de naam eenmaal hebt, zal die ook niet uit zichzelf tevoorschijn komen. De format functie wordt gebruikt om variabelen in een string te zetten.

new
   pname[24], 
   string[128];

GetPlayerName(playerid, pname, sizeof(pname))
format(string, sizeof(string), "%s is now AFK.", pname);
SendClientMessageToAll(COLOR_RED, string);

Ok! Hartstikke bedankt! Het is gelukt :) Maar, ik wil ook nog zegmaar als je /Afk doet dat er dan boven je hoofd verschijnt: This player is Afk.

Hoe kan ik dat doen?

new Text3D:label[MAX_PLAYERS];
new pname[24],string[128];

if(strcmp(cmd, "/AFK", true) == 0)
{
   GetPlayerName(playerid, pname, sizeof(pname))format(string, sizeof(string), "%s is now AFK.", pname);SendClientMessageToAll(COLOR_RED, string);
   label[playerid] = Create3DTextLabel("This player is Afk.",0x008080FF,30.0,40.0,50.0,40.0,0);
   Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
   return 1;
}
if(strcmp(cmd, "/BACK", true) == 0)
{
   GetPlayerName(playerid, pname, sizeof(pname))format(string, sizeof(string), "%s is BACK.", pname);SendClientMessageToAll(COLOR_RED, string);
   Delete3DTextLabel(label[playerid]);
   return 1;
}

Edited by ted80

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.