Raised This Month: $51 Target: $400
 12% 

question with "if"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Grafitosky
Member
Join Date: Jul 2020
Old 11-27-2020 , 11:09   question with "if"
Reply With Quote #1

how i can add to plugin this features like this one
"if (CS_OnCSWeaponDrop)
{
PrintToChatAll( "Pls, i need help!");
}
...."
or
"if(round_start) {
PrintToChatAll( "Pls, help {green} me");
}
..."
in developer language?

Last edited by Grafitosky; 11-27-2020 at 11:11.
Grafitosky is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 11-27-2020 , 11:29   Re: question with "if"
Reply With Quote #2

Quote:
Originally Posted by Grafitosky View Post
how i can add to plugin this features like this one
"if (CS_OnCSWeaponDrop)
{
PrintToChatAll( "Pls, i need help!");
}
...."
or
"if(round_start) {
PrintToChatAll( "Pls, help {green} me");
}
..."
in developer language?


Hai buddy..
look, i try to help as much as i can but your question doesn't make people get an appetite to look into.
we both have a language problem but i hope you understand that your question is not a real question.

Probably best if you just post your code and let people see it. What ever you have, just drop it.
I promise if i laugh it won't sound. My coding skill as bad as yours so please don't shy.

Edit:
To answer your question, the first one is forward so its wrong.
The second one is an event so also wrong.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 11-27-2020 at 11:36.
GsiX is offline
Grafitosky
Member
Join Date: Jul 2020
Old 11-27-2020 , 11:55   Re: question with "if"
Reply With Quote #3

Quote:
Originally Posted by GsiX View Post
Hai buddy..
look, i try to help as much as i can but your question doesn't make people get an appetite to look into.
we both have a language problem but i hope you understand that your question is not a real question.

Probably best if you just post your code and let people see it. What ever you have, just drop it.
I promise if i laugh it won't sound. My coding skill as bad as yours so please don't shy.

Edit:
To answer your question, the first one is forward so its wrong.
The second one is an event so also wrong.
okay, I want this plugin to only run for 5 seconds at the start of the round but I don't know how to do this

Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>
#include <colorvariables>

new Second;

public Action:CS_OnCSWeaponDrop(client, weapon) {
 new String:weapon_name[30];
 
   Second = 5;


      GetEntityClassname(weapon, weapon_name, sizeof(weapon_name));
   if(Second  > 5) {
   PrintToChat(client, " \x07* You cannot drop your weapont");
   return Plugin_Stop;
 }
Second--;

return Plugin_Continue;
}
"To answer your question, the first one is forward so its wrong.
The second one is an event so also wrong." - Yes, I know, but I wanted to explain that I want to do this at the beginning of the round in "if"

Last edited by Grafitosky; 11-27-2020 at 12:02.
Grafitosky is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 11-27-2020 , 13:07   Re: question with "if"
Reply With Quote #4

Quote:
Originally Posted by Grafitosky View Post
okay, I want this plugin to only run for 5 seconds at the start of the round but I don't know how to do this

Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>
#include <colorvariables>

new Second;

public Action:CS_OnCSWeaponDrop(client, weapon) {
 new String:weapon_name[30];
 
   Second = 5;


      GetEntityClassname(weapon, weapon_name, sizeof(weapon_name));
   if(Second  > 5) {
   PrintToChat(client, " \x07* You cannot drop your weapont");
   return Plugin_Stop;
 }
Second--;

return Plugin_Continue;
}
"To answer your question, the first one is forward so its wrong.
The second one is an event so also wrong." - Yes, I know, but I wanted to explain that I want to do this at the beginning of the round in "if"
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

bool g_bIsAllowed false;

public 
void OnPluginStart()
{
    
HookEvent("round_start"OnRoundStart);
}
public 
Action OnRoundStart(Event eventchar[] namebool dontBroadcast)
{
    
g_bIsAllowed false;
    
CreateTimer(5.0EnableDrop);
}
public 
Action EnableDrop(Handle timer)
{
    
g_bIsAllowed true;
}
public 
Action CS_OnCSWeaponDrop(int clientint weapon)
{
    if(!
g_bIsAllowed)
    {
        
PrintToChat(client" \x07* You cannot drop your weapon");
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue

__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode