wie kann ich ein race machen mit racecheckpoints und so?
FRAGE brauche schnell hilfe ...(check point race)
- MaRcEl9
- Geschlossen
- Erledigt
In 10 Minuten startet der nächtliche Backupvorgang! Es kann währenddessen (ca. 10 Minuten) zu Einschränkungen bei der Nutzung des Forums kommen
Weitere Infos findet ihr im Thema Backup des Forums
Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!
Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
-
-
Checkpoint erstellen, und wenn der Spieler durch den Checkpoint durch ist, den alten Checkpoint löschen den nächsten Checkpoint setzen...
-
/* Untested! */
#tryinclude <a_samp>
#define NONE_F -1.0
stock playerLastCheckpoint[MAX_PLAYERS], checkpointPos[][6] = { /* chema x,y,z, der nächste für den pfeil in dem ding, also coords fürs nächste x,y, z */
{ 0.0, 0.0, 3.0, 20.0, 90.0, 3.0},
{ 20.0, 90.0, 3.0, 50.0, 60.0, 34.0 },
{ 50.0, 60.0, 34.0, NONE_F, NONE_F, NONE_F } };
public OnPlayerConnect(playerid) {
SetPlayerRaceCheckpoint(playerid, 1, checkpointPos[0][0], checkpointPos[0][1], checkpointPos[0][2], checkpointPos[0][3], checkpointPos[0][4], checkpointPos[0][5]);
playerLastCheckpoint[playerid] = 0;
}
public OnPlayerDisconnect(playerid) {
DisablePlayerRaceCheckpoint(playerid);
}
public OnPlayerEnterRaceCheckpoint(playerid) {
if((sizeof checkpointPos - 1) == playerLastCheckpoint[playerid])
/* tu was */
else {
DisablePlayerRaceCheckpoint(playerid);
playerLastCheckpoint[playerid] += 1;
SetPlayerRaceCheckpoint(playerid, 1, checkpointPos[playerLastCheckpoint[playerid]][0], checkpointPos[playerLastCheckpoint[playerid]][1], checkpointPos[playerLastCheckpoint[playerid]][2], checkpointPos[playerLastCheckpoint[playerid]][3], checkpointPos[playerLastCheckpoint[playerid]][4], checkpointPos[playerLastCheckpoint[playerid]][5]);
}
} -
Hab ein problem mit mein renn-script. Es gibt ne menge tag mismatch und 2 mal zuviel parameter....habs markiert
#include <a_samp>
#define FILTERSCRIPT
#define rot 0xFF0000AA
#define gelb 0xFFFF00FF
#define NONE_F -1.0public OnFilterScriptInit()
{
print("Race Script by Maercell");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DisablePlayerRaceCheckpoint(playerid);
return 1;
}stock playerLastCheckpoint[MAX_PLAYERS], checkpointPos[][6] = { /* Schema x,y,z, der nächste für den pfeil in dem ding, also coords fürs nächste x,y, z */
{ 1477.3345,1763.6573,10.3776,1476.9408,1501.3993,10.3857 },
{ 1476.9408,1501.3993,10.3857,1477.5575,1193.7247,10.3908 },
{ 1477.5575,1193.7247,10.3908, NONE_F, NONE_F, NONE_F } }; /* <== Hier in den Zeilen ein Haufen tagmismatch */
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/drag",cmdtext,true) == 0)
{
if (IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),1476.5281,1824.1497,10.3834);
SetVehicleZAngle(GetPlayerVehicleID(playerid),180.0);
SetPlayerRaceCheckpoint(playerid, 1, checkpointPos[0][0], checkpointPos[0][1], checkpointPos[0][2], checkpointPos[0][3], checkpointPos[0][4], checkpointPos[0][5]);// number of arguments does not match with definition
playerLastCheckpoint[playerid] = 0;
}
else
{
SendClientMessage(playerid,rot,"Du brauchst ein Auto dazu!");
}
}
return 0;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
if((sizeof checkpointPos - 1) == playerLastCheckpoint[playerid])
{
GivePlayerMoney(playerid,10000);
SendClientMessage(playerid,gelb,"Du hast das Dragrennen gewonnen!");
GameTextForPlayer(playerid," ~g~ 10000$",1000,1);
}
else
{
DisablePlayerRaceCheckpoint(playerid);
playerLastCheckpoint[playerid] += 1;
SetPlayerRaceCheckpoint(playerid, 1, checkpointPos[playerLastCheckpoint[playerid]][0], checkpointPos[playerLastCheckpoint[playerid]][1], checkpointPos[playerLastCheckpoint[playerid]][2], checkpointPos[playerLastCheckpoint[playerid]][3], checkpointPos[playerLastCheckpoint[playerid]][4], checkpointPos[playerLastCheckpoint[playerid]][5]);// number of arguments does not match with definition
}
}Bitte, ich brauche Hilfe
PS: DMA, Glückwunsch zum 300. Beitrag, den kriegste wenn du mir hilfst xD
-
#include <a_samp>
#define rot 0xFF0000AA
#define gelb 0xFFFF00FF
#define NONE_F -1.0
/* settings */
#define SIZE_OF_CP 50.0
public OnFilterScriptInit()
{
print("Race Script by Maercell");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DisablePlayerRaceCheckpoint(playerid);
return 1;
}stock playerLastCheckpoint[MAX_PLAYERS], Float:checkpointPos[][6] = { /* Schema x,y,z, der nächste für den pfeil in dem ding,
also coords fürs nächste x,y, z */
{ 1477.3345,1763.6573,10.3776,1476.9408,1501.3993,10.3857 },
{ 1476.9408,1501.3993,10.3857,1477.5575,1193.7247,10.3908 },
{ 1477.5575,1193.7247,10.3908, NONE_F, NONE_F, NONE_F } }; /* <== Hier in den Zeilen ein Haufen tagmismatch */public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/drag",cmdtext,true) == 0)
{
if (IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),1476.5281,1824.1497,10.3834);
SetVehicleZAngle(GetPlayerVehicleID(playerid),180.0);
SetPlayerRaceCheckpoint(playerid, 1, checkpointPos[0][0], checkpointPos[0][1],
checkpointPos[0][2], checkpointPos[0][3], checkpointPos[0][4],
checkpointPos[0][5], SIZE_OF_CP);// number of arguments does not match with definition
playerLastCheckpoint[playerid] = 0;
}
else
{
SendClientMessage(playerid,rot,"Du brauchst ein Auto dazu!");
}
}
return 0;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
if((sizeof checkpointPos - 1) == playerLastCheckpoint[playerid])
{
GivePlayerMoney(playerid,10000);
SendClientMessage(playerid,gelb,"Du hast das Dragrennen gewonnen!");
GameTextForPlayer(playerid," ~g~ 10000$",1000,1);
}
else
{
DisablePlayerRaceCheckpoint(playerid);
playerLastCheckpoint[playerid] += 1;
SetPlayerRaceCheckpoint(playerid, 1, checkpointPos[playerLastCheckpoint[playerid]][0],
checkpointPos[playerLastCheckpoint[playerid]][1], checkpointPos[playerLastCheckpoint[playerid]][2],
checkpointPos[playerLastCheckpoint[playerid]][3], checkpointPos[playerLastCheckpoint[playerid]][4],
checkpointPos[playerLastCheckpoint[playerid]][5], SIZE_OF_CP);// number of arguments does not match with definition
}
}
Bitte sehr. -
-
-
Muh also Lösung: Es fehlte der Letzte Parameter und der Typ Float: :>
-
DankeDanke, keine errors/warnings, werds gleich mal testen!
-
Dankööööööö
Funzt Perfekt =)Mit Freundlichen Grüßen
mR_FatJoe -
C:\DOKUME~1\Marcel\Desktop\Sever\GAMEMO~1\freeroam.pwn(1504) : error 017: undefined symbol "checkpointPos"
C:\DOKUME~1\Marcel\Desktop\Sever\GAMEMO~1\freeroam.pwn(1507) : error 017: undefined symbol "playerLastCheckpoint"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase2 Errors.
wasn das scon wieda?
wie das defierieren?
nix nix geht jez