Argument mismatch error
#1

new str[72], skin;
switch (faction)
{
case 1: {str = "0x1732E8FF"; skin = 250;}
case 2: {str = "Name2"; skin = 12;}
case 14: {str = "Name15"; skin = 55;}
}
SetPlayerSkin(para1, skin);
SetPlayerColor(para1, str);

GM.pwn(43 : error 035: argument type mismatch (argument 2)
Reply
#2

use strval

PHP код:
new 
    
str[72], 
    
skin
;


switch (
faction)
{
    case 
1: {
        
str "0x1732E8FF"
        
skin 250;
    }
    case 
2: {
        
str "Name2"
        
skin 12;
    }
    case 
14:{
        
str "Name15"
        
skin 55;
    }
}

SetPlayerSkin(para1skin);
SetPlayerColor(para1strval(str)); 
Reply
#3

strval will return 0 since the text is not numeric. What he wants to do probably isn't setting the color but the name (atleast that "Name2" and "Name15" indicates)?
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
strval will return 0 since the text is not numeric. What he wants to do probably isn't setting the color but the name (atleast that "Name2" and "Name15" indicates)?
exactly, his need change it.
Reply
#5

I want to change the color name, not the name. Name15 is just an example.
Reply
#6

A confusing example I would say! Nevertheless, all you have to do is set the color as integer (declare a variable named "colour" for example):
pawn Код:
colour = 0x1732E8FF;
// which is equal to:
colour = 389212415;
and then:
pawn Код:
SetPlayerColor(para1, colour);
Reply
#7

What about the cases ? set the str to the colour ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)