HELP error 035: argument type mismatch (argument 2)
#1

Код:
C:\Documents and Settings\Administrator\Desktop\New Folder (15)\XS\gamemodes\SANFIERROTRCNR.pwn(5882) : warning 225: unreachable code
C:\Documents and Settings\Administrator\Desktop\New Folder (15)\XS\gamemodes\SANFIERROTRCNR.pwn(5893) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Administrator\Desktop\New Folder (15)\XS\gamemodes\SANFIERROTRCNR.pwn(5894) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Administrator\Desktop\New Folder (15)\XS\gamemodes\SANFIERROTRCNR.pwn(5895) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Administrator\Desktop\New Folder (15)\XS\gamemodes\SANFIERROTRCNR.pwn(5896) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Administrator\Desktop\New Folder (15)\XS\gamemodes\SANFIERROTRCNR.pwn(5897) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Administrator\Desktop\New Folder (15)\XS\gamemodes\SANFIERROTRCNR.pwn(5898) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.

Код:
  new cmd[256];
          new idx;
          cmd = strtok(cmdtext, idx);

			 if (strcmp(cmdtext, "/tazerenk", true) ==0) {
                new tmp[256];
                cmd = strtok(cmdtext, idx);
                if (!strlen(tmp)) {
                        SendClientMessage(playerid, 0x00E800FF, "Usage: /lasercol [color]");
                        return 1;
                }
                if (!strcmp(tmp, "red", true)) SetPlayerAttachedObject(playerid, "1", 18643);
                else if (!strcmp(tmp, "blue", true)) SetPlayerAttachedObject(playerid, "1", 19080);
                else if (!strcmp(tmp, "pink", true)) SetPlayerAttachedObject(playerid, "1", 19081);
                else if (!strcmp(tmp, "orange", true)) SetPlayerAttachedObject(playerid, "1", 19082);
                else if (!strcmp(tmp, "green", true)) SetPlayerAttachedObject(playerid, "1", 19083);
                else if (!strcmp(tmp, "yellow", true)) SetPlayerAttachedObject(playerid, "1", 19084);
                else SendClientMessage(playerid, 0x00E800FF, "Colour not available!");
                return 1;
        }

        return 0;
        }
    }
    return 1;
}
Please help how can i fix this code...
Reply
#2

Try with this. Also, if it doesn't work, make sure you reply with the line numbers, so we can help you easier.

PHP код:
new cmd[256];
new 
idx;
cmd strtok(cmdtextidx);
if (
strcmp(cmdtext"/tazerenk"true) ==0
{
    new 
tmp[256];
    
cmd strtok(cmdtextidx);
    if (!
strlen(tmp)) 
    {
        
SendClientMessage(playerid0x00E800FF"Usage: /lasercol [color]");
        return 
1;
    }
    if (!
strcmp(tmp"red"true)) SetPlayerAttachedObject(playerid"1"18643);
    else if (!
strcmp(tmp"blue"true)) SetPlayerAttachedObject(playerid"1"19080);
    else if (!
strcmp(tmp"pink"true)) SetPlayerAttachedObject(playerid"1"19081);
    else if (!
strcmp(tmp"orange"true)) SetPlayerAttachedObject(playerid"1"19082);
    else if (!
strcmp(tmp"green"true)) SetPlayerAttachedObject(playerid"1"19083);
    else if (!
strcmp(tmp"yellow"true)) SetPlayerAttachedObject(playerid"1"19084);
    else 
SendClientMessage(playerid0x00E800FF"Colour not available!");
    return 
1;

Don't forget to +rep if I helped ^^.
Reply
#3

PHP код:
if (!strcmp(tmp"red"true)) return SetPlayerAttachedObject(playerid"1"18643); 
    else if (!
strcmp(tmp"blue"true)) return  SetPlayerAttachedObject(playerid"1"19080); 
    else if (!
strcmp(tmp"pink"true)) return  SetPlayerAttachedObject(playerid"1"19081); 
    else if (!
strcmp(tmp"orange"true)) return  SetPlayerAttachedObject(playerid"1"19082); 
    else if (!
strcmp(tmp"green"true)) return  SetPlayerAttachedObject(playerid"1"19083); 
    else if (!
strcmp(tmp"yellow"true)) return  SetPlayerAttachedObject(playerid"1"19084); 
    else 
SendClientMessage(playerid0x00E800FF"Colour not available!"); 
Try this.
Reply
#4

https://sampwiki.blast.hk/wiki/SetPlayerAttachedObject

Do some research. That also means the two posts above. Rep begging with useless answers, seriously ...
Reply
#5

@Vince: Mate, don't hate on others. My reply is useless? Did you even notice he doesn't have an opening bracket at the beginning?

And this:

PHP код:
        }

        return 
0;
        } 
surely is not okay. I at least corrected those in my post. I'm not begging for rep, its just that I need a certain amount of rep to post in a certain thread. Also, people these days sometimes don't even say "thank you" let alone +rep.

Have a nice day!
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/SetPlayerAttachedObject

Do some research. That also means the two posts above. Rep begging with useless answers, seriously ...
Quote:
Originally Posted by rappy93
Посмотреть сообщение
@Vince: Mate, don't hate on others.



I'm not begging for rep, its just that I need a certain amount of rep to post in a certain thread. Also, people these days sometimes don't even say "thank you" let alone +rep.

Have a nice day!
What he said + don't be so hateful.
Reply
#7

Quote:
Originally Posted by rappy93
Посмотреть сообщение
@Vince: Mate, don't hate on others. My reply is useless? Did you even notice he doesn't have an opening bracket at the beginning?

And this:

PHP код:
        }
        return 
0;
        } 
surely is not okay. I at least corrected those in my post. I'm not begging for rep, its just that I need a certain amount of rep to post in a certain thread. Also, people these days sometimes don't even say "thank you" let alone +rep.

Have a nice day!
If so do not put this in the end "+REP me if I helped" Vince is absolutely correct, this section is to help others and explain them their faults so they can learn scripting not for REP begging lol

OT: Tag mismatch means that you didn't right correct the function or you missed some parametres the correct parameters for SetPlayerAttachedObject is

Код:
SetPlayerAttachedObject(playerid, index, modelid, bone, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ, materialcolor1, materialcolor2)
Try to change your code with the above parameters
Reply
#8

Quote:
Originally Posted by rappy93
Посмотреть сообщение
surely is not okay. I at least corrected those in my post. I'm not begging for rep, its just that I need a certain amount of rep to post in a certain thread. Also, people these days sometimes don't even say "thank you" let alone +rep.

Have a nice day!
Which thread? There's no reputation limit on any thread. Just the Server Advertisements board requires specific reputation points in order to prevent spam and dodgy servers.
Reply
#9

Quote:
Originally Posted by rappy93
Посмотреть сообщение
@Vince: Mate, don't hate on others. My reply is useless? Did you even notice he doesn't have an opening bracket at the beginning?
No, I didn't. That was a fault on my part. I tend to solve one problem at a time and the very obvious ones usually get priority; there is no way that there would be a string in SetPlayerAttachedObject and that is also what the error is referring to; it expects and integer value yet encounters a string.
Reply
#10

search in ****** for a laser filterscript, that will help you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)