Jump to content
View in the app

A better way to browse. Learn more.

Forum Supreme-Elite

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.

Featured Replies

#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");

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 by kriax

SourcePawn Compiler 1.4.0

Copyright © 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.

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.

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...

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.