[UNSOLVED] Please Help this /warn System
#1

Can Anyone help this Im getting this errors , I don't know how to fix it
pawn Код:
if(strcmp(cmdtext, "/warn", true) == 0)
{
new reason[128];
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,CORAL,"USAGE: /warn [playerid] [reason]");
return 1;
}
if(targetid != INVALID_PLAYER_ID)
{
new str[128];
GetPlayerName(playerid,admin,sizeof(admin));
GetPlayerName(targetid,name,sizeof(name));
reason = bigstrtok(cmdtext, idx);
if(!strlen(reason)) return SendClientMessage(playerid,CORAL,"USAGE: /warn [playerid] [reason]");
format(str,sizeof(str),"You have been warned by VIP Member %s(%d) for %s",admin, playerid, reason);
SendClientMessage(targetid,ORANGE,str);
format(string,sizeof(string),"%s(%d) has been warned by %s(%d) for %s",name,targetid,admin,playerid,reason);
SendClientMessageToAll(RED,string);
}
else if(targetid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid,CORAL,"Invalid ID");
}
}
else return 0;

pawn Код:
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(92) : error 017: undefined symbol "tmp"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(92) : error 017: undefined symbol "strtok"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(93) : error 017: undefined symbol "tmp"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(95) : error 017: undefined symbol "CORAL"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(98) : error 017: undefined symbol "targetid"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(101) : error 017: undefined symbol "admin"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(101) : error 017: undefined symbol "admin"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(101) : error 029: invalid expression, assumed zero
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(101) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.
Reply
#2

See what you get when you copy other scripts ?
Search for strtok and put it anywhere in your script.
Put #define CORAL <some color hex value> on top of your script
Put new tmp[256], admin[MAX_PLAYER_NAME], targetid; on top of OnPlayerComandText()
Reply
#3

C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(92) : error 017: undefined symbol "tmp" > Under new string[128]; > new tmp[128];
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(92) : error 017: undefined symbol "strtok" > put the strtok finction in your script... > SEARCH (:
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(93) : error 017: undefined symbol "tmp" > see first error
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(95) : error 017: undefined symbol "CORAL" > Put a collor here (For ex 0x33AAFFAA = Blue)
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(9 : error 017: undefined symbol "targetid" > under new string[128]; > new targetid;
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(101) : error 017: undefined symbol "admin" > under new string blabalaa > new admin[MAX_PLAYERS];
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(101) : error 017: undefined symbol "admin" > See above error

Код:
if(strcmp(cmdtext, "/warn", true) == 0)
{
new reason[128];
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,CORAL,"USAGE: /warn [playerid] [reason]");
return 1;
}
if(targetid != INVALID_PLAYER_ID)
{
new str[128];
new tmp[128];
new admin[MAX_PLAYERS];
GetPlayerName(playerid,admin,sizeof(admin));
GetPlayerName(targetid,name,sizeof(name));
reason = bigstrtok(cmdtext, idx);
if(!strlen(reason)) return SendClientMessage(playerid,0x33AAFFAA,"USAGE: /warn [playerid] [reason]");
format(str,sizeof(str),"You have been warned by VIP Member %s(%d) for %s",admin, playerid, reason);
SendClientMessage(targetid,ORANGE,str);
format(string,sizeof(string),"%s(%d) has been warned by %s(%d) for %s",name,targetid,admin,playerid,reason);
SendClientMessageToAll(RED,string);
}
else if(targetid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid,CORAL,"Invalid ID");
}
}
else return 0;
Reply
#4

Quote:
Originally Posted by dice7
See what you get when you copy other scripts ?
Search for strtok and put it anywhere in your script.
Put #define CORAL <some color hex value> on top of your script
Put new tmp[256], admin[MAX_PLAYER_NAME], targetid; on top of OnPlayerComandText()
Thanks and I copied it because i had to
Reply
#5

You'll need to add this to your code:
pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply
#6

Quote:
Originally Posted by TheFluxThing
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(92) : error 017: undefined symbol "tmp" > Under new string[128]; > new tmp[128];
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(92) : error 017: undefined symbol "strtok" > put the strtok finction in your script... > SEARCH (:
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(93) : error 017: undefined symbol "tmp" > see first error
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(95) : error 017: undefined symbol "CORAL" > Put a collor here (For ex 0x33AAFFAA = Blue)
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(9 : error 017: undefined symbol "targetid" > under new string[128]; > new targetid;
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(101) : error 017: undefined symbol "admin" > under new string blabalaa > new admin[MAX_PLAYERS];
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(101) : error 017: undefined symbol "admin" > See above error

Код:
if(strcmp(cmdtext, "/warn", true) == 0)
{
new reason[128];
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,CORAL,"USAGE: /warn [playerid] [reason]");
return 1;
}
if(targetid != INVALID_PLAYER_ID)
{
new str[128];
new tmp[128];
new admin[MAX_PLAYERS];
GetPlayerName(playerid,admin,sizeof(admin));
GetPlayerName(targetid,name,sizeof(name));
reason = bigstrtok(cmdtext, idx);
if(!strlen(reason)) return SendClientMessage(playerid,0x33AAFFAA,"USAGE: /warn [playerid] [reason]");
format(str,sizeof(str),"You have been warned by VIP Member %s(%d) for %s",admin, playerid, reason);
SendClientMessage(targetid,ORANGE,str);
format(string,sizeof(string),"%s(%d) has been warned by %s(%d) for %s",name,targetid,admin,playerid,reason);
SendClientMessageToAll(RED,string);
}
else if(targetid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid,CORAL,"Invalid ID");
}
}
else return 0;
can you please fix everything for me idk how to do al those , Im tried and got rid of some errors but not all
Reply
#7

Quote:
Originally Posted by Skulls
Quote:
Originally Posted by TheFluxThing
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(92) : error 017: undefined symbol "tmp" > Under new string[128]; > new tmp[128];
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(92) : error 017: undefined symbol "strtok" > put the strtok finction in your script... > SEARCH (:
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(93) : error 017: undefined symbol "tmp" > see first error
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(95) : error 017: undefined symbol "CORAL" > Put a collor here (For ex 0x33AAFFAA = Blue)
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(9 : error 017: undefined symbol "targetid" > under new string[128]; > new targetid;
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(101) : error 017: undefined symbol "admin" > under new string blabalaa > new admin[MAX_PLAYERS];
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(101) : error 017: undefined symbol "admin" > See above error

Код:
if(strcmp(cmdtext, "/warn", true) == 0)
{
new reason[128];
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,CORAL,"USAGE: /warn [playerid] [reason]");
return 1;
}
if(targetid != INVALID_PLAYER_ID)
{
new str[128];
new tmp[128];
new admin[MAX_PLAYERS];
GetPlayerName(playerid,admin,sizeof(admin));
GetPlayerName(targetid,name,sizeof(name));
reason = bigstrtok(cmdtext, idx);
if(!strlen(reason)) return SendClientMessage(playerid,0x33AAFFAA,"USAGE: /warn [playerid] [reason]");
format(str,sizeof(str),"You have been warned by VIP Member %s(%d) for %s",admin, playerid, reason);
SendClientMessage(targetid,ORANGE,str);
format(string,sizeof(string),"%s(%d) has been warned by %s(%d) for %s",name,targetid,admin,playerid,reason);
SendClientMessageToAll(RED,string);
}
else if(targetid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid,CORAL,"Invalid ID");
}
}
else return 0;
can you please fix everything for me idk how to do al those , Im tried and got rid of some errors but not all
You might wan't to try the script I posted..
Reply
#8

pawn Код:
C:\Users\HIJOL GOSWAMI\PremiumPackage.pwn(93) : error 017: undefined symbol "strtok"
C:\Users\HIJOL GOSWAMI\PremiumPackage.pwn(93) : error 029: invalid expression, assumed zero
C:\Users\HIJOL GOSWAMI\PremiumPackage.pwn(93) : error 017: undefined symbol "string"
C:\Users\HIJOL GOSWAMI\PremiumPackage.pwn(93) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Im still getting this errors
Reply
#9

Quote:
Originally Posted by Skulls
pawn Код:
C:\Users\HIJOL GOSWAMI\PremiumPackage.pwn(93) : error 017: undefined symbol "strtok"
C:\Users\HIJOL GOSWAMI\PremiumPackage.pwn(93) : error 029: invalid expression, assumed zero
C:\Users\HIJOL GOSWAMI\PremiumPackage.pwn(93) : error 017: undefined symbol "string"
C:\Users\HIJOL GOSWAMI\PremiumPackage.pwn(93) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Im still getting this errors
Put the following code somewhere in your script;
Код:
strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}
 
	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	}
And put under "new str[128];" in your command "new string[128];''
Reply
#10

pawn Код:
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(94) : error 017: undefined symbol "strtok"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(94) : error 029: invalid expression, assumed zero
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(94) : error 029: invalid expression, assumed zero
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\pawno\PremiumPackage.pwn(94) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
I did what everyone has told and one more error which is this
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)