Help me, please laser system
#1

I'am tryin make a laser system but I have some errors. Please Help me and I am sorry for my bad english.

Код:
C:\Users\Mertcan\Desktop\mod\v2.0 - Windows\gamemodes\tcgaming.pwn(25217) : error 010: invalid function or declaration
C:\Users\Mertcan\Desktop\mod\v2.0 - Windows\gamemodes\tcgaming.pwn(25226) : warning 209: function "cmd_lazerkapat" should return a value
C:\Users\Mertcan\Desktop\mod\v2.0 - Windows\gamemodes\tcgaming.pwn(25227) : error 010: invalid function or declaration
C:\Users\Mertcan\Desktop\mod\v2.0 - Windows\gamemodes\tcgaming.pwn(25245) : warning 209: function "cmd_lazerrenk" should return a value
C:\Users\Mertcan\Desktop\mod\v2.0 - Windows\gamemodes\tcgaming.pwn(25246) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

3 Errors.
PHP код:
CMD:lazerac(playeridparams[])
    if(
PlayerInfo[playerid][pDonator]>0)
    {
        
SetPVarInt(playerid"laser"1);
         
SetPVarInt(playerid"color"GetPVarInt(playerid"color"));
    }
    else 
SendClientMessage(playeridCOLOR_GREY"VIP değilsin.");
    return 
1;//////Line 25217
}
CMD:lazerkapat(playeridparams[])
    if(
PlayerInfo[playerid][pDonator]>0)
    {
        
SetPVarInt(playerid"laser"0);
         
RemovePlayerAttachedObject(playerid0);
    }
    else return 
SendClientMessage(playeridCOLOR_GREY"VIP değilsin.");//////Line 25226
    
return 1;//////Line 25227
}
CMD:lazerrenk(playeridparams[])
    if(
PlayerInfo[playerid][pDonator]>0)
    {
        new 
color[16];
        if(
sscanf(params"s[15]"color)) return SendClientMessage(playeridC_GREY"Kullanım: /lazerrenk [renk]");
        
SendClientMessage(playeridC_GREY"Kirmizi, Mavi, Pembe, Turuncu, Yeşil, Sari");
        if(!
strcmp(color"kirmizi"true)) SetPVarInt(playerid"color"18643);
        else if(!
strcmp(color"mavi"true)) SetPVarInt(playerid"color"19080);
        else if(!
strcmp(color"pembe"true)) SetPVarInt(playerid"color"19081);
        else if(!
strcmp(color"turuncu"true)) SetPVarInt(playerid"color"19082);
        else if(!
strcmp(color"yeşil"true)) SetPVarInt(playerid"color"19083);
        else if(!
strcmp(color"sari"true)) SetPVarInt(playerid"color"19084);
        else 
SendClientMessage(playeridC_VIOLET"Geзerli Bir Renk Seзmediniz!");
    }
    else return 
SendClientMessage(playeridCOLOR_GREY"VIP değilsin.");//////Line 25245
    
return 1;//////Line 25246

Reply
#2

Somebody Can Help Me?
Reply
#3

Show us the line which you got error
Reply
#4

Quote:
Originally Posted by kyriakos587
Посмотреть сообщение
Show us the line which you got error
I already show.if you look more carefully I was write. For examble I was wrote

PHP код:
    else return SendClientMessage(playeridCOLOR_GREY"VIP değilsin.");//////Line 25226
    
return 1;//////Line 25227 
Reply
#5

+++++
Reply
#6

Try to change COLOR_GREY to 0xd3d3d3ff.
Example :
Код:
SendClientMessage(playerid, COLOR_GREY, "VIP değilsin.");
Change to :
Код:
SendClientMessage(playerid, 0xd3d3d3ff, "VIP değilsin.");
Reply
#7

Quote:
Originally Posted by bondowocopz
Посмотреть сообщение
Try to change COLOR_GREY to 0xd3d3d3ff.
Example :
Код:
SendClientMessage(playerid, COLOR_GREY, "VIP değilsin.");
Change to :
Код:
SendClientMessage(playerid, 0xd3d3d3ff, "VIP değilsin.");

Now I Have This Errors

PHP код:
C:\Users\Mertcan\Desktop\mod\v2.0 Windows\gamemodes\tcgaming.pwn(25216) : warning 209: function "cmd_lazerac" should return a value
C
:\Users\Mertcan\Desktop\mod\v2.0 Windows\gamemodes\tcgaming.pwn(25217) : error 010invalid function or declaration
C
:\Users\Mertcan\Desktop\mod\v2.0 Windows\gamemodes\tcgaming.pwn(25226) : warning 209: function "cmd_lazerkapat" should return a value
C
:\Users\Mertcan\Desktop\mod\v2.0 Windows\gamemodes\tcgaming.pwn(25227) : error 010invalid function or declaration
C
:\Users\Mertcan\Desktop\mod\v2.0 Windows\gamemodes\tcgaming.pwn(25245) : warning 209: function "cmd_lazerrenk" should return a value
C
:\Users\Mertcan\Desktop\mod\v2.0 Windows\gamemodes\tcgaming.pwn(25246) : error 010invalid function or declaration
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
3 Errors

PHP код:
CMD:lazerac(playeridparams[])
    if(
PlayerInfo[playerid][pDonator]>0)
    {
        
SetPVarInt(playerid"laser"1);
         
SetPVarInt(playerid"color"GetPVarInt(playerid"color"));
    }
    else return 
SendClientMessage(playerid0xd3d3d3ff"VIP değilsin.");/////Line25216
    
return 1;/////Line25217
}
CMD:lazerkapat(playeridparams[])
    if(
PlayerInfo[playerid][pDonator]>0)
    {
        
SetPVarInt(playerid"laser"0);
         
RemovePlayerAttachedObject(playerid0);
    }
    else return 
SendClientMessage(playerid0xd3d3d3ff"VIP değilsin.");/////Line25226
    
return 1;/////Line25227
}
CMD:lazerrenk(playeridparams[])
    if(
PlayerInfo[playerid][pDonator]>0)
    {
        new 
color[16];
        if(
sscanf(params"s[15]"color)) return SendClientMessage(playeridC_GREY"Kullanım: /lazerrenk [renk]");
        
SendClientMessage(playeridC_GREY"Kirmizi, Mavi, Pembe, Turuncu, Yeşil, Sari");
        if(!
strcmp(color"kirmizi"true)) SetPVarInt(playerid"color"18643);
        else if(!
strcmp(color"mavi"true)) SetPVarInt(playerid"color"19080);
        else if(!
strcmp(color"pembe"true)) SetPVarInt(playerid"color"19081);
        else if(!
strcmp(color"turuncu"true)) SetPVarInt(playerid"color"19082);
        else if(!
strcmp(color"yeşil"true)) SetPVarInt(playerid"color"19083);
        else if(!
strcmp(color"sari"true)) SetPVarInt(playerid"color"19084);
        else 
SendClientMessage(playeridC_VIOLET"Geзerli Bir Renk Seзmediniz!");
    }
    else return 
SendClientMessage(playerid0xd3d3d3ff"VIP değilsin.");/////Line25245
    
return 1;/////Line25246

Reply
#8

PHP код:
#define COLOR_GREY 0xd3d3d3ff
#define COLOR_GREY 0xd3d3d3ff
CMD:lazerac(playeridparams[]) {
    if(
PlayerInfo[playerid][pDonator]>0) { 
        
SetPVarInt(playerid"laser"1); 
        
SetPVarInt(playerid"color"GetPVarInt(playerid"color")); 
    } else { 
        
SendClientMessage(playeridCOLOR_GREY"VIP değilsin.");
    }
    return 
1;//////Line 25217 

CMD:lazerkapat(playeridparams[])  {
    if(
PlayerInfo[playerid][pDonator]>0) { 
        
SetPVarInt(playerid"laser"0); 
         
RemovePlayerAttachedObject(playerid0); 
    } else {
        
SendClientMessage(playeridCOLOR_GREY"VIP değilsin.");//////Line 25226 
    
}
    return 
1;//////Line 25227 

CMD:lazerrenk(playeridparams[]) {
    if(
PlayerInfo[playerid][pDonator]>0) { 
        new 
color[16]; 
        if(
sscanf(params"s[15]"color)) {
            
SendClientMessage(playeridC_GREY"Kullanım: /lazerrenk [renk]"); 
            return 
1;
        }
        
SendClientMessage(playeridC_GREY"Kirmizi, Mavi, Pembe, Turuncu, Yeşil, Sari"); 
        if(!
strcmp(color"kirmizi"true)) {
            
SetPVarInt(playerid"color"18643); 
        } else if(!
strcmp(color"mavi"true)) {
            
SetPVarInt(playerid"color"19080);
        } else if(!
strcmp(color"pembe"true)) {
            
SetPVarInt(playerid"color"19081);
        } else if(!
strcmp(color"turuncu"true)) {
            
SetPVarInt(playerid"color"19082);
        } else if(!
strcmp(color"yeşil"true)) {
            
SetPVarInt(playerid"color"19083); 
        } else if(!
strcmp(color"sari"true)) {
            
SetPVarInt(playerid"color"19084); 
        } else {
            
SendClientMessage(playeridC_VIOLET"Geзerli Bir Renk Seзmediniz!");
        }
    } else {
        
SendClientMessage(playeridCOLOR_GREY"VIP değilsin.");//////Line 25245 
    
}
    return 
1;//////Line 25246 


The above could should compile just fine


1, you weren't opening the command block.. You were just closing it..
Makes your code basically error every time...

Every time you make a command you must OPEN the command block and CLOSE it...
PHP код:
CMD:CommandName(playeridparams[], help) { //// <---- Opened
     
if(help) { // <---- OPENED
          
SendClientMessage(playerid, -1"Blah blah Blah");
          return 
1;
     } 
// <-- CLOSED the IF statement.
// CLOSED the command statement. 
Reply
#9

try this
PHP код:
CMD:lazerac(playeridparams[])
    if(
PlayerInfo[playerid][pDonator]>0)
    {
        
SetPVarInt(playerid"laser"1);
         
SetPVarInt(playerid"color"GetPVarInt(playerid"color"));
    }
    else return 
SendClientMessage(playerid0xd3d3d3ff"VIP değilsin.");
}
CMD:lazerkapat(playeridparams[])
    if(
PlayerInfo[playerid][pDonator]>0)
    {
        
SetPVarInt(playerid"laser"0);
         
RemovePlayerAttachedObject(playerid0);
    }
    else return 
SendClientMessage(playerid0xd3d3d3ff"VIP değilsin.");
}
CMD:lazerrenk(playeridparams[])
    if(
PlayerInfo[playerid][pDonator]>0)
    {
        new 
color[16];
        if(
sscanf(params"s[15]"color)) return SendClientMessage(playeridC_GREY"Kullanım: /lazerrenk [renk]");
        
SendClientMessage(playeridC_GREY"Kirmizi, Mavi, Pembe, Turuncu, Yeşil, Sari");
        if(!
strcmp(color"kirmizi"true)) SetPVarInt(playerid"color"18643);
        else if(!
strcmp(color"mavi"true)) SetPVarInt(playerid"color"19080);
        else if(!
strcmp(color"pembe"true)) SetPVarInt(playerid"color"19081);
        else if(!
strcmp(color"turuncu"true)) SetPVarInt(playerid"color"19082);
        else if(!
strcmp(color"yeşil"true)) SetPVarInt(playerid"color"19083);
        else if(!
strcmp(color"sari"true)) SetPVarInt(playerid"color"19084);
        else 
SendClientMessage(playeridC_VIOLET"Geзerli Bir Renk Seзmediniz!");
    }
    else return 
SendClientMessage(playerid0xd3d3d3ff"VIP değilsin.");

Reply
#10

PHP код:
#define       COLOR_GREY       0xAFAFAFAA 
Already defined
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)