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.

SetPlayerPos

Hey, ik heb weer een probleem, waarvan ik zeg ' Hoe is dit mogelijk.. :puh:'.

Ik wil dat als iemand dood gaat IG, ze een bill moeten betalen, dit werkt allemaal MAAR als ze dood gaan moeten ze wel naar een bepaalde locatie gaan.

Hier is de code:

{
{
	new Float:hospx = 2650.3025;
	new Float:hospy = 639.0163;
	new Float:hospz = 14.4531;
		SetPlayerPos(playerid, hospx,hospy,hospz);
	}
SendClientMessage(playerid, color_pred, " You've died, now you will have to pay a bill of 240dollars, /payhbill to do so ");
TogglePlayerControllable(playerid, false);
return 1;

}

Probleem: SetPlayerPos werkt niet, als iemand dood gaat komt hij midden in een woestijn en... nja freezed daar zoals behoren...

Featured Replies

Bovenaan:

new PayBill[MAX_PLAYERS];

MAX_PLAYERS kan ook iets anders zijn, weet niet zeker. :$

OnPlayerDeath:

{
SetPlayerPos(playerid, 2650.3025, 639.0163, 14.4531);
SendClientMessage(playerid, color_pred, " You've died, now you will have to pay a bill of 240dollars, /payhbill to do so ");
TogglePlayerControllable(playerid, false);
PayBill[playerid] = 1;
return 1;

}

OnPlayerCommandText:

{
if(PayBill[playerid] == 1)
{
	// Tekstgedoe dat je moet intypen, als betaald is gebruik je PayBill[playerid] = 0;
}
}

OnPlayerConnect & OnPlayerDisconnect:

{
PayBill[playerid] = 0;
}

Edited by Basssss

  • Author

En hoe maak je dit zo dat als iemand uit logt terwijl hij PayBill == 1 is dat als hij weer inlogt nog steeds frozen is?

Heb veel geprobeerd met boolereans enz.. Maar kom er niet uit.

  • Author

Als ik dood gaat, spawn ik bij me normale spawnplek maar ik hoor te spawnen bij de SF hospital, dit is de code:

public OnPlayerSpawn(playerid)
{
SetPlayerColor(playerid, 0xffffff00);
SetPlayerScore(playerid, 1337);
	if(dini_Bool(udb_encode(playername), "Death?:") == 1)
{
 	SendClientMessage(playerid, color_pred, " You've died, now you will have to pay a bill of 240dollars, /payhbill to do so ");
 	TogglePlayerControllable(playerid, false);
 	SetPlayerHealth(playerid, 10.0);
 	SetPlayerPos(playerid, -2650.3025,639.0163,14.4531);
 	return 1;
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerPos(playerid, 2650.3025, 639.0163, 14.4531);
SendClientMessage(playerid, color_pred, " You've died, now you will have to pay a bill of 240dollars, /payhbill to do so ");
TogglePlayerControllable(playerid, false);
SetPlayerHealth(playerid, 10.0);
PayBill[playerid] = 1;
return 1;

}

new DoodGegaan[MAX_PLAYERS];

OnPlayerConnect(playerid)
{
Doodgegaan[playerid] = 0;
}

OnPlayerSpawn(playerid)
{
if(DoodGegaan[playerid] == 1)
{
	SetPlayerPos(...);
}
}

OnPlayerDeath(playerid)
{
DoodGegaan[playerid] = 1;
}

@ hieronder Oh ja, vergeten :7

@daaronder: NEE, NATUURLIJK NIET! ANDERS ZOU IK HET TOCH NIET ZO ZEGGEN! LUISTER EENS NAAR DE PRO'S :@

Edited by David22

OnPlayerSpawn(playerid)
{
if(DoodGegaan[playerid] == 1)
{
	SetPlayerPos(...);
	DoodGegaan[playerid] = 0;
}
}

Anders denkt de server dat je altijd dood bent. :puh:

  • Author

Moet het niet zijn:

if(dini_Bool(udb_encode(playername), "text") == 1 of 0)

I.p.v if(doodgegaan =1/0 ) ?

En natuurlijk dini_BoolSet(udb etc) ?

  • Author

Als ik bijv een command /enter heb, dan spawn ik bij een plaats MAAR zonder texteriors ( buildings/bomen etc) hoe solve ik dit? :S

PS: Sorry voor dubbel post... was vergeten dak vorige post had gemaakt ^_^

Edited by 1112rutger

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.