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.

Commands maken

Hallo ik ben een beginnende scripter.

Ik heb laatste een job toegevoegd in me script het werkt alleen maal TOP, maar 1 probleempje is ik kan nu geen nieuwe commands toevoegen want dan krijg ik error's van pawno.

Dit is een command om de job te starten.

Ik wil nog meer commands toevoegen zoals admin commands maar dat lukt allenmaal niet.

Dit is me command

{

if (strcmp("/limousine", cmdtext, true, 10) == 0)

{

if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 409)

{

LimousineJob[playerid] = 1;

new name[MAX_PLAYER_NAME], string[48];

GetPlayerName(playerid, name, sizeof(name));

format(string, sizeof(string), "* %s is now a Driver.", name );

SendClientMessageToAll(yellow, string);

SetPlayerCheckpoint(playerid,1484.8270,-1737.0692,13.2602,10);

SendClientMessage(playerid,green,"* Follow the red markers to get the passagier!");

return 1;

}

SendClientMessage(playerid, red,"You have to be in a limousine to start the job!");

}

return 0;

}

als ik hier een command wil bij voegen zoals /help

regel 206= {

regel 207= if (strcmp("/help", cmdtext, true, 10) == 0)

regel 208= {

regel 209= SendClientMessage(playerid, yellow,"Hallo");

regel 210= return 1;

regel 211= }

krijg ik deze error's

pwn(206) : error 055: start of function body without function header

pwn(207) : error 010: invalid function or declaration

pwn(210) : error 010: invalid function or declaration

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

3 Errors.

Alvast bedankt voor jullie hulp.

Featured Replies

Kun je de complete OnPlayerCommandText even plaatsen, het liefst tussen code-tags? :)

  • Author

public OnPlayerCommandText(playerid, cmdtext[])

{

if (strcmp("/limousine", cmdtext, true, 10) == 0)

{

if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 409)

{

LimousineJob[playerid] = 1;

new name[MAX_PLAYER_NAME], string[48];

GetPlayerName(playerid, name, sizeof(name));

format(string, sizeof(string), "* %s is now a Driver.", name );

SendClientMessageToAll(yellow, string);

SetPlayerCheckpoint(playerid,1484.8270,-1737.0692,13.2602,10);

SendClientMessage(playerid,green,"* Follow the red markers to get the passagier!");

return 1;

}

SendClientMessage(playerid, red,"You have to be in a limousine to start the job!");

}

return 0;

}

{

if (strcmp("/help", cmdtext, true, 10) == 0)

{

SendClientMessage(playerid, yellow,"Hallo");

return 1;

}

Edited by Noize_Cornell

public OnPlayerCommandText(playerid, cmdtext[])
{
   if (strcmp("/limousine", cmdtext, true, 10) == 0)
   {
       if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 409)
       {
           LimousineJob[playerid] = 1;
           new name[MAX_PLAYER_NAME], string[48];
           GetPlayerName(playerid, name, sizeof(name));
           format(string, sizeof(string), "* %s is now a Driver.", name );
           SendClientMessageToAll(yellow, string);
           SetPlayerCheckpoint(playerid,1484.8270,-1737.0692,13.2602,10);
           SendClientMessage(playerid,green,"* Follow the red markers to get the passagier!");
           return 1;
       }
       SendClientMessage(playerid, red,"You have to be in a limousine to start the job!");
   }
   return 0;
}
{
   if (strcmp("/help", cmdtext, true, 10) == 0)
   {
       SendClientMessage(playerid, yellow,"Hallo");
       return 1;
   }

Zo zou je code eruitzien als je de regels voor inspringen aanhoudt. Dan zie je zo het probleem: je plaatst je commando buiten de callback OnPlayerCommandText en je hebt een accolade (openen) te veel.

  • Author

oke thanks zal kijken of het werkt

Nope weer errors

(206) : error 055: start of function body without function header

(207) : error 010: invalid function or declaration

(210) : error 010: invalid function or declaration

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Edited by Noize_Cornell

Ga niet klakkeloos kopiëren en plakken, want zo leer je namelijk helemaal niets. VWO'er heeft niets veranderd aan jouw code. Hij liet gewoon zien waar de fout zit, zodat jij hem kan fixen.

  • Author

Dan heb ik het verkeerd gelezen maar ik snap dan niet wat hij bedoelt met je zet je commando buiten de callback kunnen jullie dat misschien wat beter uit leggen en of heeft iemand een goede tut waar dat staat

alvast bedankt

Correcte code voor lazy programmer!

public OnPlayerCommandText(playerid, cmdtext[])

{

if (strcmp("/limousine", cmdtext, true, 10) == 0)

{

if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 409)

{

LimousineJob[playerid] = 1;

new name[MAX_PLAYER_NAME], string[48];

GetPlayerName(playerid, name, sizeof(name));

format(string, sizeof(string), "* %s is now a Driver.", name );

SendClientMessageToAll(yellow, string);

SetPlayerCheckpoint(playerid,1484.8270,-1737.0692,13.2602,10);

SendClientMessage(playerid,green,"* Follow the red markers to get the passagier!");

}

else

{

SendClientMessage(playerid, red,"You have to be in a limousine to start the job!");

}

return 1;

}

if (strcmp("/help", cmdtext, true, 10) == 0)

{

SendClientMessage(playerid, yellow,"Hallo");

return 1;

}

return 0;

}

Edited by Crusher!!

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.