I'm getting an error with GivePlayerItem() and the round_start hook params.
GivePlayerItem() code and error:
Spoiler
Code:
else if (rdm2 == 2){
//low gravity round
for (int i = 0; i <= MAXPLAYERS; i++){
if (IsPlayerAlive(i) && IsClientInGame(i)){
SetEntityGravity(i, 0.5);
}
}
}
Error:
Code:
C:\Users\NOTMYNAME\AppData\Roaming\spedit\sourcepawn\scripts\special.sp(44) : error 017: undefined symbol "GivePlayerItem"
Done
round_start code and error:
Spoiler
Code:
public void OnRoundStart(Handle event, const char name[], bool dontBroadcast){
rdm = GetRandomInt(1, 5);
rdm2 = GetRandomInt(1, 3);
if (rdm == 1){
if (rdm2 == 1){
//1hp special round.
for (int i = 0; i <= MAXPLAYERS; i++){
if (IsPlayerAlive(i) && IsClientInGame(i)){
SetEntityHealth(i, 1);
}
}
PrintToChatAll("[SM] Don't fuck up. Everyone has 1HP, good luck. :D");
}
else if (rdm2 == 2){
//low gravity round
for (int i = 0; i <= MAXPLAYERS; i++){
if (IsPlayerAlive(i) && IsClientInGame(i)){
SetEntityGravity(i, 0.5);
}
}
}
else{
//zeus round!
for (int i = 0; i <= MAXPLAYERS; i++)
if (IsPlayerAlive(i) && IsClientInGame(i)){
GivePlayerItem(i, "taser");
}
}
}
}
Error:
Code:
C:\Users\NOTMYNAME\AppData\Roaming\spedit\sourcepawn\scripts\special.sp(19) : error 159: brackets after variable name indicate a fixed-size array, but size could not be determined - either specify sizes, an array initializer, or use dynamic syntax (such as 'char[] x')
FULL CODE:
Spoiler
Code:
#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION "1.0"
int rdm;
int rdm2;
public Plugin myinfo = {
name = "",
author = "blade",
description = "",
version = PLUGIN_VERSION,
url = ""
};
public OnPluginStart(){
HookEvent("round_start", OnRoundStart);
}
public void OnRoundStart(Handle event, const char name[], bool dontBroadcast){
rdm = GetRandomInt(1, 5);
rdm2 = GetRandomInt(1, 3);
if (rdm == 1){
if (rdm2 == 1){
//1hp special round.
for (int i = 0; i <= MAXPLAYERS; i++){
if (IsPlayerAlive(i) && IsClientInGame(i)){
SetEntityHealth(i, 1);
}
}
PrintToChatAll("[SM] Don't fuck up. Everyone has 1HP, good luck. :D");
}
else if (rdm2 == 2){
//low gravity round
for (int i = 0; i <= MAXPLAYERS; i++){
if (IsPlayerAlive(i) && IsClientInGame(i)){
SetEntityGravity(i, 0.5);
}
}
}
else{
//zeus round!
for (int i = 0; i <= MAXPLAYERS; i++)
if (IsPlayerAlive(i) && IsClientInGame(i)){
GivePlayerItem(i, "taser");
}
}
}
}