AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   What is a problem? (https://forums.alliedmods.net/showthread.php?t=309934)

Enes05 08-12-2018 21:48

What is a problem?
 
Hello everyone

Firstly im sorry for my bad english :grrr:
I ran into a problem.
This plugin is not working.
can someone solve it?

This plugin: (In round start strip all weapons and gives awp and deagle all players)

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <multicolors>
#pragma tabsize 0

public OnPluginStart()
{
HookEvent("round_start", RoundStart);
}

public Action:RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
ServerCommand("sm_strip @all 1 2 3 4 5 6");
ServerCommand("sm_give @all awp");
ServerCommand("sm_give @all deagle");
CPrintToChatAll("{darkred} AWP {orange}and {darkred} DEAGLE {orange}gived to all players);
}


What's the matter?

Psyk0tik 08-12-2018 21:55

Re: What is a problem?
 
You're missing a quotation mark.

Before:

PHP Code:

CPrintToChatAll("{darkred} AWP {orange}and {darkred} DEAGLE {orange}gived to all players); 

After:

PHP Code:

CPrintToChatAll("{darkred} AWP {orange}and {darkred} DEAGLE {orange}gived to all players"); 


Enes05 08-12-2018 22:00

Re: What is a problem?
 
I've fixed it but it's still not working
(they did not make an error when they compiled)

mug1wara 08-12-2018 22:13

Re: What is a problem?
 
”Deagle” and ”Awp” aren’t valid entities.

Also you don’t want to youse servercommands when there are already functions. Use GivePlayerItem instead.

Enes05 08-12-2018 22:24

Re: What is a problem?
 
ServerCommand("sm_strip @all 1 2 3 4 5 6");
GivePlayerItem("weapon_awp");
GivePlayerItem("weapon_deagle");

this a true?

im new to sourcepawn coding, im sorry

Psyk0tik 08-12-2018 22:27

Re: What is a problem?
 
Quote:

Originally Posted by Enes05 (Post 2609882)
ServerCommand("sm_strip @all 1 2 3 4 5 6");
GivePlayerItem("weapon_awp");
GivePlayerItem("weapon_deagle");

this a true?

im new to sourcepawn coding, im sorry

PHP Code:

for (int i 1<= MaxClientsi++)
{
    if (
IsClientInGame(i) && IsPlayerAlive(i))
    {
        
GivePlayerItem(i"weapon_awp");
        
GivePlayerItem(i"weapon_deagle");
    }



Enes05 08-12-2018 22:51

Re: What is a problem?
 
can someone do it and throw the source code? it still not working


All times are GMT -4. The time now is 15:11.

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