had3s99 Posté(e) le 29 avril 2016 Share Posté(e) le 29 avril 2016 (modifié) Bonjour, Sachant que je commence à Dev en 1.7 j'ai une erreur que je comprend pas x) public Action OnRoundStart(Handle event, char[], bool dontBroadcast) error 001: expected token: "-identifier-", but found "," D'où vient mon erreur ? Et dîtes moi SMLIB n'est plus fonctionnel sous 1.7 ? Et mon autre erreur public Action OnTakeDamage(int client, &attacker, &inflictor, &float damage, &damagetype) fatal error 189: too many error messages on one line Et la dernière erreur SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage); Bout de code public OnClientDisconnect(client){ if (IsClientInGame(client)) { if(DvStart[client]) { FinDv(client); CPrintToChatAll("%s %N a déconnecté pendant sa dernière volonté", Prefix, client); } SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage); } } error 100: function prototypes do not match Modifié le 22 mai 2016 par Kriax Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Kriax Posté(e) le 29 avril 2016 Share Posté(e) le 29 avril 2016 public Action OnRoundStart(Handle event, const char[] name, bool dontBroadcast) public Action OnTakeDamage(int client, int &attacker, int &inflictor, float &damage, int &damagetype) public void OnClientDisconnect(int client) { if (IsClientInGame(client)) { if(DvStart[client]) { FinDv(client); CPrintToChatAll("%s %N a déconnecté pendant sa dernière volonté", Prefix, client); } SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage); } } Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
had3s99 Posté(e) le 29 avril 2016 Auteur Share Posté(e) le 29 avril 2016 (modifié) SpawnProps() { int prop1 = CreateEntityByName("prop_physics_override"); DispatchKeyValue(prop1, "skin", "0"); DispatchKeyValue(prop1, "targetname", "bookcase"); SetEntityModel(prop1, "models/props/cs_havana/bookcase_small.mdl"); DispatchKeyValueFloat (prop1, "MaxPitch", 360.00); DispatchKeyValueFloat (prop1, "MinPitch", -360.00); DispatchKeyValueFloat (prop1, "MaxYaw", 90.00); DispatchSpawn(prop1); int prop2 = CreateEntityByName("prop_physics_override"); DispatchKeyValue(prop2, "skin", "0"); DispatchKeyValue(prop2, "targetname", "bookcase"); SetEntityModel(prop2, "models/props/cs_havana/bookcase_small.mdl"); DispatchKeyValueFloat (prop2, "MaxPitch", 360.00); DispatchKeyValueFloat (prop2, "MinPitch", -360.00); DispatchKeyValueFloat (prop2, "MaxYaw", 90.00); DispatchSpawn(prop2); int prop3 = CreateEntityByName("prop_physics_override"); DispatchKeyValue(prop3, "skin", "0"); DispatchKeyValue(prop3, "targetname", "bookcase"); SetEntityModel(prop3, "models/props/cs_havana/bookcase_small.mdl"); DispatchKeyValueFloat (prop3, "MaxPitch", 360.00); DispatchKeyValueFloat (prop3, "MinPitch", -360.00); DispatchKeyValueFloat (prop3, "MaxYaw", 90.00); DispatchSpawn(prop3); int prop4 = CreateEntityByName("prop_physics_override"); DispatchKeyValue(prop4, "skin", "0"); DispatchKeyValue(prop4, "targetname", "bookcase"); SetEntityModel(prop4, "models/props/cs_havana/bookcase_small.mdl"); DispatchKeyValueFloat (prop4, "MaxPitch", 360.00); DispatchKeyValueFloat (prop4, "MinPitch", -360.00); DispatchKeyValueFloat (prop4, "MaxYaw", 90.00); DispatchSpawn(prop4); int prop5 = CreateEntityByName("prop_physics_override"); DispatchKeyValue(prop5, "skin", "0"); DispatchKeyValue(prop5, "targetname", "bookcase"); SetEntityModel(prop5, "models/props/cs_havana/bookcase_small.mdl"); DispatchKeyValueFloat (prop5, "MaxPitch", 360.00); DispatchKeyValueFloat (prop5, "MinPitch", -360.00); DispatchKeyValueFloat (prop5, "MaxYaw", 90.00); DispatchSpawn(prop5); int prop6 = CreateEntityByName("prop_physics_override"); DispatchKeyValue(prop6, "skin", "0"); DispatchKeyValue(prop6, "targetname", "bookcase"); SetEntityModel(prop6, "models/props/cs_havana/bookcase_small.mdl"); DispatchKeyValueFloat (prop6, "MaxPitch", 360.00); DispatchKeyValueFloat (prop6, "MinPitch", -360.00); DispatchKeyValueFloat (prop6, "MaxYaw", 90.00); DispatchSpawn(prop6); TeleportEntity(prop1, float{ -1204.0, -1620.0, 4.1 }, float{ 0.0, 90.0, 0.0 }, NULL_VECTOR); TeleportEntity(prop2, float{ -1204.0, -1680.0, 4.1 }, float{ 0.0, 90.0, 0.0 }, NULL_VECTOR); TeleportEntity(prop3, float{ -1204.0, -1740.0, 4.1 }, float{ 0.0, 90.0, 0.0 }, NULL_VECTOR); TeleportEntity(prop4, float{ -1204.0, -1800.0, 4.1 }, float{ 0.0, 90.0, 0.0 }, NULL_VECTOR); TeleportEntity(prop5, float{ -1204.0, -1860.0, 4.1 }, float{ 0.0, 90.0, 0.0 }, NULL_VECTOR); TeleportEntity(prop6, float{ -1204.0, -1920.0, 4.1 }, float{ 0.0, 90.0, 0.0 }, NULL_VECTOR); SetEntityMoveType(prop1, MOVETYPE_NONE); SetEntityMoveType(prop2, MOVETYPE_NONE); SetEntityMoveType(prop3, MOVETYPE_NONE); SetEntityMoveType(prop4, MOVETYPE_NONE); SetEntityMoveType(prop5, MOVETYPE_NONE); SetEntityMoveType(prop6, MOVETYPE_NONE); } Au début je voulais faire juste un prop mais j'ai dû répéter donc code pas trop propre je sais pas si on peut pas simplifier tout ça :$ Erreur : warning 219: local variable "prop2" shadows a variable at a preceding level warning 219: local variable "prop3" shadows a variable at a preceding level warning 219: local variable "prop4" shadows a variable at a preceding level warning 219: local variable "prop5" shadows a variable at a preceding level warning 219: local variable "prop6" shadows a variable at a preceding level error 028: invalid subscript (not an array or too many subscripts): "float" warning 219: local variable "MOVETYPE_NONE" shadows a variable at a preceding level error 181: function argument named 'MOVETYPE_NONE' differs from prototype error 021: symbol already defined: "SetEntityMoveType" error 010: invalid function or declaration fatal error 189: too many error messages on one line Compilation aborted. 5 Errors. Compilation Time: 0,53 sec Et p'tite question le "Void" à quoi sert-il exactement ? Modifié le 29 avril 2016 par had3s99 Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Kriax Posté(e) le 29 avril 2016 Share Posté(e) le 29 avril 2016 Le void il sert à retourner rien du tout x) Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Kriax Posté(e) le 29 avril 2016 Share Posté(e) le 29 avril 2016 Essaie ça : public void SpawnProps() { for (int i = 1; i <= 5; i++) { int prop = CreateEntityByName("prop_physics_override"); DispatchKeyValue(prop, "skin", "0"); DispatchKeyValue(prop, "targetname", "bookcase"); SetEntityModel(prop, "models/props/cs_havana/bookcase_small.mdl"); DispatchKeyValueFloat (prop, "MaxPitch", 360.00); DispatchKeyValueFloat (prop, "MinPitch", -360.00); DispatchKeyValueFloat (prop, "MaxYaw", 90.00); DispatchSpawn(prop); SetEntityMoveType(prop, MOVETYPE_NONE); TeleportEntity(prop, float{ -1204.0, -1620.0 + (60.0 * i), 4.1 }, float{ 0.0, 90.0, 0.0 }, NULL_VECTOR); } } Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
had3s99 Posté(e) le 29 avril 2016 Auteur Share Posté(e) le 29 avril 2016 Oh merci ! ça fonctionne ^^ vraiment étrange ce "void", et dit moi le decl String faut le remplacer par quoi en 1.7 maintenant ? Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Kriax Posté(e) le 29 avril 2016 Share Posté(e) le 29 avril 2016 String deviens Char :) Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
had3s99 Posté(e) le 29 avril 2016 Auteur Share Posté(e) le 29 avril 2016 (modifié) Ah d'accord je pensais que le decl devais être traduis aussi ^^ Merci de ton aide :) et dernière question qui me trotte dans la tête for(new i=1;i<=MaxClients;i++) { //code } Pour la première ligne je mets new ou int ? Car ça me mets aucunes erreurs pour les deux cas. Modifié le 29 avril 2016 par had3s99 Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Kriax Posté(e) le 29 avril 2016 Share Posté(e) le 29 avril 2016 int ^^ Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
had3s99 Posté(e) le 30 avril 2016 Auteur Share Posté(e) le 30 avril 2016 (modifié) error 028: invalid subscript <not an array or too many subcripts>: "float" for (int i = 1; i <= 5; i++) { int prop = CreateEntityByName("prop_physics_override"); DispatchKeyValue(prop, "skin", "0"); DispatchKeyValue(prop, "targetname", "bookcase"); SetEntityModel(prop, "models/props/cs_havana/bookcase_small.mdl"); DispatchKeyValueFloat (prop, "MaxPitch", 360.00); DispatchKeyValueFloat (prop, "MinPitch", -360.00); DispatchKeyValueFloat (prop, "MaxYaw", 90.00); DispatchSpawn(prop); SetEntityMoveType(prop, MOVETYPE_NONE); TeleportEntity(prop, float{ -1204.0, -1620.0 + (60.0 * i), 4.1 }, float{ 0.0, 90.0, 0.0 }, NULL_VECTOR); } Edit problème résolu Modifié le 30 avril 2016 par had3s99 Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Messages recommandés
Rejoindre la conversation
Vous pouvez publier maintenant et vous inscrire plus tard. Si vous avez un compte, connectez-vous maintenant pour publier avec votre compte.