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

hello.

i have a problem on : {

PHP код:
(7521) : error 035argument type mismatch (argument 2
codes:
PHP код:
public OnPlayerConnect(playerid)
{    
    
    new 
strrr[512]; // line 7513
    
new Name[512]; // line 7514
    
GetPlayerName(playeridNamesizeof(Name)); // line 7515
    
for(new 0;c>30;c++) { // line 7517
    
new strr[55]; // line 7518
    
format(strrsizeof(strr), "[%s]"DynamicClans[c][cTag]); // line 7519
    
if(HasClanTag(playeridstrr))  // line 7520
    
// line 7521
    
string_replace(Name strr" "); // line 7522
    
SetPlayerName(playeridName); // line 7523
    
// line 7524
    
// line 7525 
line 7521:

PHP код:

Reply
#2

Show us the HasClanTag and string_replace functions.
Reply
#3

Problem is string_replace:

stock string_replace(string[], find, replace)
{
for(new i=0; string[i]; i++)
{
if(string[i] == find)
{
string[i] = replace;
}
}
}
Reply
#4

Quote:
Originally Posted by AmirHossaiN
Посмотреть сообщение
Problem is string_replace:

stock string_replace(string[], find, replace)
{
for(new i=0; string[i]; i++)
{
if(string[i] == find)
{
string[i] = replace;
}
}
}
When you are creating parameters for a function, [] indicates that the parameter is going to be a string, Float: ofcourse will be a float and just a variable name will be an integer. In the code you provided, you are using all three parameters as strings.
Код:
string_replace(Name , strr, " ");
So I think it's pretty clear what you should do.
Reply


Forum Jump:


Users browsing this thread: