Jump 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.

WTF!?

Hier een gedeelte van mijn script dat plotseling niet wilt compilen + foutmeldingen. Nu we dan toch bezig zijn, hoe kan ik zeggen dat slechts Stammetje91 hem kan gebruiken?

Code:

public OnPlayerSpawn(playerid)

{

if(GetPlayerSkin(playerid)== 61) {

if(adminlevel[playerid] >= 2)

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

SendClientMessage(playerid, COLOR_RED, "Only Stammetje91 can use this skin!");

}

return 1;

}

if(GetPlayerSkin(playerid)== 249) {

if(adminlevel[playerid] >= 2)

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

SendClientMessage(playerid, COLOR_RED, "Only SlakX can use this skin!");

}

return 1;

}

if(GetPlayerSkin(playerid)== 265) {

if(adminlevel[playerid] >= 2)

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

SendClientMessage(playerid, COLOR_RED, "Only admins are allowed to use this skin!");

}

return 1;

}

if(GetPlayerSkin(playerid)== 266) {

if(adminlevel[playerid] >= 2)

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

SendClientMessage(playerid, COLOR_RED, "Only admins are allowed to use this skin!");

}

return 1;

}

if(GetPlayerSkin(playerid)== 267) {

if(adminlevel[playerid] >= 2)

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

SendClientMessage(playerid, COLOR_RED, "Only admins are allowed to use this skin!");

}

return 1;

}

if(GetPlayerSkin(playerid)== 268) {

if(adminlevel[playerid] >= 2)

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

SendClientMessage(playerid, COLOR_RED, "Only admins are allowed to use this skin!");

}

return 1;

}

if(GetPlayerSkin(playerid)== 269) {

if(adminlevel[playerid] >= 2)

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

SendClientMessage(playerid, COLOR_RED, "Only admins are allowed to use this skin!");

}

return 1;

}

if(GetPlayerSkin(playerid)== 270) {

if(adminlevel[playerid] >= 2)

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

SendClientMessage(playerid, COLOR_RED, "Only admins are allowed to use this skin!");

}

return 1;

}

if(GetPlayerSkin(playerid)== 271) {

if(adminlevel[playerid] >= 2)

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

SendClientMessage(playerid, COLOR_RED, "Only admins are allowed to use this skin!");

}

return 1;

}

if(GetPlayerSkin(playerid)== 272) {

if(adminlevel[playerid] >= 2)

SetPlayerHealth(playerid, 0);

ForceClassSelection(playerid);

SendClientMessage(playerid, COLOR_RED, "Only admins are allowed to use this skin!");

}

return 1;

}

if(logged[playerid] == 0)

{

SendClientMessage(playerid, COLOR_RED, "You're not logged in yet! Use /login [password]!");

}

return 1;

}

Foutmeldingen:

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(229) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(230) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(235) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(238) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(239) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(244) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(247) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(248) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(253) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(256) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(257) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(262) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(265) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(266) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(271) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(274) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(275) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(280) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(283) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(284) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(289) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(292) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(293) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(298) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(301) : error 010: invalid function or declaration

C:\Documents and Settings\Gebruiker\Bureaublad\SAMP\gamemodes\GrandTheftParty.pwn(302) : error 010: invalid function or declaration

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

26 Errors.

Edited by Stammetje91

Featured Replies

Volgens mij heb je overal een } te veel. Heb er niet zoveel verstand van maar geloof dat dat het is :puh:

Juist te weinig, want hij is achter de 2e 'if' een accolade vergeten. Achter iedere 'if' moet altijd een {, en bij return een }. Houd hier wel rekening mee, want dat is de fout die je maakt.

  • Author
Juist te weinig, want hij is achter de 2e 'if' een accolade vergeten. Achter iedere 'if' moet altijd een {, en bij return een }. Houd hier wel rekening mee, want dat is de fout die je maakt.

Ik ben nog in de leer. :puh: Bedankt! Is er dan nog iemand die me kan vertellen hoe ik een skin alleen gebruikt kan worden door Stammetje91 (of een andere account).

Edited by Stammetje91

Juist te weinig, want hij is achter de 2e 'if' een accolade vergeten. Achter iedere 'if' moet altijd een {, en bij return een }. Houd hier wel rekening mee, want dat is de fout die je maakt.

Ik ben nog in de leer. :puh: Bedankt! Is er dan nog iemand die me kan vertellen hoe ik een skin alleen gebruikt kan worden door Stammetje91 (of een andere account).

Je kan Strcmp() gebruiken, ik vind dat ik niet die code hoef voor te kauwen aangezien je in de leer bent, en het dus een goede oefening is, ik kan je wel een eind opweg helpen..

new naam1[MAX_PLAYER_NAME];						
GetPlayerName(playerid,naam1,MAX_PLAYER_NAME);

Met deze code definieer je een variabele, de inhoud daarvan is de username/nickname van de speler die op dat moment de skin aan het kiezen is.

Je moet dus Strcmp gebruiken om "Stampertje" en 'naam1' te comparen/vergelijken (strCMP=Compare)

Succes ermee, mocht je er echt niet uitkomen, dan hoor ik het wel..

if(GetPlayerSkin(playerid)== 61) 
{
new pname[32];
GetPlayerName(playerid,pname,32);

if(!equal(pname,"Stammetje91",false))
{
			SetPlayerHealth(playerid,0.0);
	ForceClassSelection(playerid);
	SendClientMessage(playerid, COLOR_RED, "Only Stammetje91 can use this skin!");
}
}

Edited by [FA]Raven

...Code van [FA]Raven'...

1. Typfoutje:

if(!equal(pname,"Stammetje91",false)

moet zijn:

if(!equal(pname,"Stammetje91",false))

2. 'equal' is hetzelfde als 'strcmp'

3. Bij jou code moet de speler pas een andere skin kiezen zodra hij doodgaat.

4. Je kan deze code beter bij public OnPlayerRequestSpawn(playerid) neerzetten.

public OnPlayerRequestSpawn(playerid)
{
if(GetPlayerSkin(playerid)== 61)
{
new pname[32];
GetPlayerName(playerid,pname,32);
	if(strcmp(pname,"Stammetje91",false))
{
	GameTextForPlayer(playerid, "~r~Stammetje91 only!", 1500, 3);
	return 0;
	}
}
return 1;
}

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

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.