• 29 Mars 2024, 00:16:17


Auteur Sujet: Re : [====Problème de GM====]  (Lu 8073 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne Armans

  • *
  • Tueur en série
  • Messages: 173
    • Voir le profil
Re : [====Problème de GM====]
« le: 11 Août 2011, 02:27:06 »
Je sais je suis chiant mais âpre que j'ai bien compris je vous soulerez même plus   :boulet


donc voici mon gm sais qu'un debut il fait a base des commande trouver sur gta online et iv:mp pour savoir comment et fait le Squrrel donc mon gm se lance mais il y a ni mes commande ni se que j'ai fait:


/**
 * donc début de mon premier GM Montreuil'Z City
 * Par moi M'Boy'Z
 */
 
function onScriptInit()
{
log("-----------------------------------");
log("M'Boy'Z");
log("-----------------------------------");
return 1;
}

local SpawnCar = { };
const White = 0xFFFFFFAA;
const Blue = 0X0000FFAA;
const Green = 0X00FF00AA;
const Red = 0XFF0000AA;

function onPlayerConnect(playerid)
{
SpawnCar[playerid] <- 999;
sendMessageToAll(White, getPlayerName(playerid) + (" + playerid + ") a rejoint le serveur !"); //Ici, c'est le message pour tous les joueurs.
setPlayerSpawnLocation(playerid, -341.36, 1144.80, 14.79, 40.114815);
return 1;
}

function onPlayerDisconnect ( playerid, reason )
{
 if(reason == 0) //Le joueur quitte normalement le serveur.
 {
 sendMessageToAll(White, getPlayerName(playerid) + " (" + playerid + ") a quitté le serveur !");
 }
 else if(reason == 1)//Le joueur a crash.
 {
 sendMessageToAll(White, getPlayerName(playerid) + " (" + playerid + ") a quitté le serveur ! <Timeout>");
 }
 return 1;
}

function onPlayerSpawn( playerid )
{
    setPlayerSpawnLocation(playerid, -107.637474, -57.117714, 14.607281, 143.784836);
    return true;
}
addEvent("playerSpawn", onPlayerSpawn);


function onPlayerCommand(playerid, command)
{
local cmd = split(command, " ");
if(cmd[0] == "/v" || cmd[0] == "/cv") //Le /v et le /cv permette de faire la même chose
{
if(cmd.len() == 2)
{
local mid = cmd[1].tointeger();
if(mid >= 0 && mid <= 125)
{
if(SpawnCar[playerid] != 999)
{
destroyVehicle(SpawnCar[playerid]);
SpawnCar[playerid] = 999;
}
local pos = getPlayerCoordinates(playerid);
SpawnCar[playerid] = createVehicle(mid, pos[0] + 1, pos[1] + 1, pos[2] + 1, 0, 1, 1, 1, 1);
sendPlayerMessage(playerid,Green, "Spawn réussi !");
}
   if(cmd[0] == "/Airport" || cmd[0] == "/airport")
            {
            setPlayerCoordinates(playerid, 2342.356934, 390.643127, 6.085225);
            sendPlayerMessage(playerid, Green, "Bienvenu à l'aéroport.");
            }
    if(cmd[0] == "/arme1")
{
addPlayerWeapon(playerid, 11, 1000);
setPlayerHealth(playerid, 100);
setPlayerArmour(playerid, 100);
}
if(cmd[0] == "/arme2")
{
addPlayerWeapon(playerid, 12, 1000);
setPlayerHealth(playerid, 100);
setPlayerArmour(playerid, 100);
}
if(cmd[0] == "/arme3")
{
addPlayerWeapon(playerid, 20, 1000);
setPlayerHealth(playerid, 100);
setPlayerArmour(playerid, 100);
}
if(cmd[0] == "/donnervie") //cmd[0] is the very first word of the command string. [0] will always be the very first word of every split string.
    {
        setPlayerHealth(playerid, 200); //Set your health to 100% (NOTE: In IV:MP, 200 HP is really 100%, so 150 is really 50% and so on).
        sendPlayerMessage(playerid, 0xFFFFFFAA, "Vous avez mis votre vie a 100%");
        return 1; //Return 1 in all commands.
    }
if(cmd[0].tolower() == "/gui")
          triggerClientEvent(playerid, "showGUI");
          }  
}
}
return 0;
}
addEvent("playerCommand", onPlayerCommand);

donc voila sais mon gros problème.
« Modifié: 11 Août 2011, 02:30:18 par Samir|M'Boy'Z|Luccioni »



Fait un GM a partir de rien

Hors ligne ApocKalipsS

  • *
  • Gangster
  • **** | Une experience GTA IV hors du commun !
  • Messages: 1141
    • Voir le profil
Re : Re : [====Problème de GM====]
« Réponse #1 le: 11 Août 2011, 10:41:12 »
Tu es sûr de bien avoir ajouté ton script à settings.xml ? Tu l'as bien mit dans scripts ? Il n'y a pas d'erreur dans ta console ?
Et fait attention à ton indentation.

Hors ligne Armans

  • *
  • Tueur en série
  • Messages: 173
    • Voir le profil
Re : Re : [====Problème de GM====]
« Réponse #2 le: 11 Août 2011, 16:54:22 »
eux attant car moi je préférer encore le serveur.cfg c'était plus simple car la le setting sais une vrais merde :lmfao:



<settings>
<!-- Port the server will listen on -->
<port>9999</port>

<!-- The port the webserver listens on -->
<httpport>9998</httpport>

<!-- An external webserver that you host your files on, can be either the server's name or IP -->
<!-- httpserver>example.com</httpserver -->

<!-- Maximum number of players the server will support (Max 32) -->
<maxplayers>32</maxplayers>

<!-- Maximum number of vehicles the server will support (Max 65534) -->
<maxvehicles>400</maxvehicles>

<!-- Password clients will have to enter to connect -->
<!-- password>None</password -->

<!-- Add the server to the master list -->
<listed>false</listed>

<!-- The hostname players will see -->
<hostname>IV:MP Server</hostname>

<!-- The address the server will bind to -->
<!-- hostaddress>127.0.0.1</hostaddress -->

<!-- Toggles frequently called events which has impact on CPU usage  -->
<frequentevents>false</frequentevents>

<!-- The scripts the server will load and run -->
<scripts>GUITEST.nut</scripts>

<!-- The scripts the client will download and run -->
<clientscript>GMM.nut</clientscript>

<!-- The resources the client will download and used by clientscripts -->
<!-- clientresource>ivmp.png</clientresource -->

<!-- The modules the server will load and run -->
<!-- For windows: -->
<!-- module>Sample.dll</module -->
<!-- For linux: -->
<!-- module>Sample.so</module -->
</settings>



Fait un GM a partir de rien

Hors ligne Gilux

  • *
  • Mafioso
  • GOOBY PLS
  • Messages: 2209
    • Voir le profil
Re : Re : [====Problème de GM====]
« Réponse #3 le: 11 Août 2011, 17:27:40 »
<script>lenomduscriptquetuveuxlancer.nut</script>
Et je crois pas que ton script s'appelle guitest.nut ;)

Sinon je trouve le fichier .xml bien plus simple à utiliser :D (Peut être que c'est plus simple pour les codeurs HTML...)
 

Hors ligne ApocKalipsS

  • *
  • Gangster
  • **** | Une experience GTA IV hors du commun !
  • Messages: 1141
    • Voir le profil
Re : Re : [====Problème de GM====]
« Réponse #4 le: 11 Août 2011, 20:00:49 »
Fait attention à la casse.

J'ai fait un panel IV:MP et SA:MP, et le XML est 4000x mieux qu'un simple fichier texte...

Hors ligne Armans

  • *
  • Tueur en série
  • Messages: 173
    • Voir le profil
Re : Re : [====Problème de GM====]
« Réponse #5 le: 12 Août 2011, 01:19:16 »
Déjà j'ai rien pigée a votre charabia  :lmfao est en plus quant je met mon GM dans <scripte>GMM.nut</scripte> il demare pas donc voila xD.



Fait un GM a partir de rien

Hors ligne Karting06

  • *
  • Grand Banditisme
  • Messages: 650
    • Voir le profil
Re : Re : [====Problème de GM====]
« Réponse #6 le: 12 Août 2011, 08:02:22 »
C'est <script>GGM.nut>/script>

Toi, tu as ajouté un "e". Donc, ça ne pouvait pas marcher.

Hors ligne Armans

  • *
  • Tueur en série
  • Messages: 173
    • Voir le profil
Re : Re : [====Problème de GM====]
« Réponse #7 le: 15 Août 2011, 01:06:23 »
 <script>GGM.nut>/script> sais pas plutot  <script>GGM.nut</script>



Fait un GM a partir de rien