aww.... new error record =(
#1

Hey guys, it's me again =(

I made a simple cmd, but anything's wrong...
Код:
dcmd_curse(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][pVip] == 5)
	{
	    if(!strlen(params)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /curse [PlayerID]") &&
	    SendClientMessage(playerid, orange, "Function: Will Curse the specified player!");
	    new Player1[MAX_PLAYER_NAME];
	    new string[128];
	    new player1;
	    player1 = strval(params);//lol where did u copy this from

	    
        if(AccInfo[player1][curse] == 0)
	    {
   		curse[playerid] = Create3DTextLabel("CURSED",0x000000AA,30.0,40.0,50.0,40.0,0);
    		Attach3DTextLabelToPlayer(curse[playerid], player1, 0.0, 0.0, 0.7);
 		GetPlayerName(playerid,Player1,sizeof(Player1));
    		format(string,sizeof(string),"Dark Lord %s has cursed &s!",playername,Player1);
        	SendClientMessageToAll(RED,string);
		AccInfo[player1][curse] = 1;
   		SetPlayerHealth(player1,1);
   		SetPlayerArmour(player1,1);
    		}
    		else
    		{
    		AccInfo[player1][curse] = 0;
    		SpawnPlayer(player1);
    		Delete3DTextLabel(curse[playerid]);
    		new string[44];
    		GetPlayerName(playerid, Player1, sizeof(Player1));
    		format(string, sizeof(string), "Dark Lord %s has released %s!",playername,Player1);
        	SendClientMessageToAll(RED,string);
		}
		return 1;
      }
      else return ErrorMessages(playerid, 21);
}
Код:
C:\Users\Niko\Desktop\NEW SERVER\filterscripts\LuxAdmin.pwn(8036) : error 033: array must be indexed (variable "curse")
C:\Users\Niko\Desktop\NEW SERVER\filterscripts\LuxAdmin.pwn(8041) : error 017: undefined symbol "playername"
C:\Users\Niko\Desktop\NEW SERVER\filterscripts\LuxAdmin.pwn(8043) : error 033: array must be indexed (variable "curse")
C:\Users\Niko\Desktop\NEW SERVER\filterscripts\LuxAdmin.pwn(8049) : error 033: array must be indexed (variable "curse")
C:\Users\Niko\Desktop\NEW SERVER\filterscripts\LuxAdmin.pwn(8052) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Niko\Desktop\NEW SERVER\filterscripts\LuxAdmin.pwn(8054) : error 017: undefined symbol "playername"
The script starts at Line 8022 (dcmd_curse)

Can anyone help me, please? O.o
Reply
#2

Just wondering,how are you planning to use parameters if you have clearly defined not to use them?

As for the rest:
playername is not defined,notice it might have be PlayerName,Pawn language is case- sensitive.
The array of the variable 'curse' is not indexed.
And the variable string is already defined somewhere in your script.
Reply
#3

Код:
dcmd_curse(playerid,params[])
{
    GetPlayerName(playerid,PlayerName,sizeof(PlayerName));    
    #pragma unused params
    if(AccInfo[playerid][pVip] == 5)
	{
	    if(!strlen(params)) return
		SendClientMessage(playerid, LIGHTBLUE2, "Usage: /curse [PlayerID]") &&
		SendClientMessage(playerid, orange, "Function: Will Curse the specified player!");
		new Player1[MAX_PLAYER_NAME];
		new string[128];
		new player1;
	    player1 = strval(params);//lol where did u copy this from

	    
        if(AccInfo[player1][curse] == 0)
	    {
   			curse[playerid] = Create3DTextLabel("CURSED",0x000000AA,30.0,40.0,50.0,40.0,0);
    		Attach3DTextLabelToPlayer(curse[playerid], player1, 0.0, 0.0, 0.7);
 			GetPlayerName(playerid,Player1,sizeof(Player1));
    		format(string,sizeof(string),"Dark Lord %s has cursed &s!",playername,Player1);
        	SendClientMessageToAll(RED,string);
			AccInfo[player1][curse] = 1;
   			SetPlayerHealth(player1,1);
   			SetPlayerArmour(player1,1);
    		}
    		else
    		{
    		AccInfo[player1][curse] = 0;
    		SpawnPlayer(player1);
    		Delete3DTextLabel(curse[playerid]);
    		new string[44];
    		GetPlayerName(playerid, Player1, sizeof(Player1));
    		format(string, sizeof(string), "Dark Lord %s has released %s!",playername,Player1);
        	SendClientMessageToAll(RED,string);
		}
		return 1;
    }
	else return ErrorMessages(playerid, 21);
}
try this
Reply
#4

thanks, it worked =D
Thank you guys
*give evyrone a cookie*
Good Night ^.^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)