August 18, 201213 yr comment_114574 #include <sourcemod> #include <sdktools> #include <cstrike> public Plugin:myinfo = { name = "PHRASE ALEATOIRE", author = "MAX9Z", description = "phrase aleatoire", version = "1.0", } public OnMapStart() { HookEvent("GetRandomInt", GetRandomInt); } public Action:GetRandomInt(Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid")); PrintToChat(client, "PHRASE QUE JE VEU"); Report
August 18, 201213 yr comment_114576 http://www.freeman59.fr/wp-content/uploads/2009/05/pelleteuse2.jpg Report
August 18, 201213 yr comment_114581 Tu créé un timer de ce genre : #include <sourcemod> #include <sdktools> #include <cstrike> public OnMapStart() { CreateTimer(90.0, Timer_Pub); { public Action:Timer_Pub(Handle:timer) { switch (GetRandomInt(1, 3)) { case 1: { PrintToChatAll("Phrase 1"); } case 2: { PrintToChatAll("Phrase 1"); } case 3: { PrintToChatAll("Phrase 1"); } } } Edit : Petite erreur de ma part xD Edited August 19, 201213 yr by kriax Report
August 20, 201213 yr comment_114795 SourcePawn Compiler 1.4.0Copyright © 1997-2006, ITB CompuPhase, ©2004-2008 AlliedModders, LLC /groups/sourcemod/upload_tmp/textdkfIyu.sp(8) : error 017: undefined symbol "Timer_Pub"/groups/sourcemod/upload_tmp/textdkfIyu.sp(12) : error 029: invalid expression, assumed zero/groups/sourcemod/upload_tmp/textdkfIyu.sp(12) : warning 221: label name "Action" shadows tag name/groups/sourcemod/upload_tmp/textdkfIyu.sp(12) : error 017: undefined symbol "Timer_Pub"/groups/sourcemod/upload_tmp/textdkfIyu.sp(32) : error 030: compound statement not closed at the end of file (started at line 12) 4 Errors. Report
August 20, 201213 yr comment_114800 Voici la correction : #include <sourcemod> #include <sdktools> #include <cstrike> public OnMapStart() { CreateTimer(90.0, Timer_Pub, _, TIMER_REPEAT); } public Action:Timer_Pub(Handle:timer) { switch (GetRandomInt(1, 3)) { case 1: { PrintToChatAll("Phrase 1"); } case 2: { PrintToChatAll("Phrase 1"); } case 3: { PrintToChatAll("Phrase 1"); } } } J'ai ouvert le OnMapStart() et je l'ai fermer par l'accolade d'ouverture, ces une erreur chiante qui m'arrive tout le temps quand je me presse xD Kriax. Report
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.