Raised This Month: $ Target: $400
 0% 

error 035: argument type mismatch (argument 1)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rutger177
New Member
Join Date: Mar 2014
Old 03-29-2014 , 06:44   error 035: argument type mismatch (argument 1)
Reply With Quote #1

if(!isNumeric(tmp))
{
giveplayerid = ReturnUser(playerid, tmp);
12892: if(giveplayerid == INVALID_PLAYER_ID) This line
{
return 1;




dcmd_complain(playerid, params[])
{
new idx,id,giveplayerid,string[256],tmp[256],cmd[256],message[256];
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /complain (Name/Id) (complaint)");
return 1;
}
if(!isNumeric(tmp))
{
14373 giveplayerid = ReturnUser(playerid, tmp); This Line
if(giveplayerid == INVALID_PLAYER_ID)
{
return 1;
}



dcmd_setadmin(playerid, params[])
{
if (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdminLevel] > 2){
new idx,Level,giveplayerid,string[256],tmp[256];
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /setadmin (Name/Id) (level) - Enter A Valid Name/Id");
return 1;
}
if(!isNumeric(tmp))
{
14456 giveplayerid = ReturnUser(playerid, tmp); This Line
if(giveplayerid == INVALID_PLAYER_ID)
{
return 1;
}



Plz Help my
rutger177 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-29-2014 , 06:45   Re: error 035: argument type mismatch (argument 1)
Reply With Quote #2

Show us ReturnUser
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
rutger177
New Member
Join Date: Mar 2014
Old 03-29-2014 , 06:49   Re: error 035: argument type mismatch (argument 1)
Reply With Quote #3

Thanks for post here is my ReturnUser


// ReturnUser (By Y_Less)
stock ReturnUser(playerid, text[])//http://pyrokid.pastebin.com/f57277676
{
new pos = 0,string[256];
while (text[pos] < 0x21) // Strip out leading spaces
{
if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text
pos++;
}
new userid = INVALID_PLAYER_ID;
if (isNumeric(text[pos])) // Check whole passed string
{
// If they have a numeric name you have a problem (although names are checked on id failure)
userid = strval(text[pos]);
if (userid >=0 && userid < MAX_PLAYERS)
{
if(!IsPlayerConnected(userid))
{
if (playerid != INVALID_PLAYER_ID)
{
//SendClientMessage(playerid, 0xFF0000AA, "User not connected");
format(string, 256, "%s Is Not A Valid ID.", text);
if (playerid == -1)
{
//IRC_Say(gBotID, IRC_CHANNEL, string);
}else{
SendClientMessage(playerid, COLOR_ERROR, string);
}
}
userid = INVALID_PLAYER_ID;
}
else
{
return userid; // A player was found
}
}
/*else
{
if (playerid != INVALID_PLAYER_ID)
{
//SendClientMessage(playerid, 0xFF0000AA, "Invalid user ID");
format(string, 256, "%s Is Not A Valid ID.", text);
SendClientMessage(playerid, COLOR_ERROR, string);
}
userid = INVALID_PLAYER_ID;
}*/
return userid;
// Removed for fallthrough code
}
// They entered [part of] a name or the id search failed (check names just incase)
new len = strlen(text[pos]);
new count = 0;
new name[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i, name, sizeof (name));
if (strcmp(name, text[pos], true, len) == 0) // Check segment of name
{
if (len == strlen(name)) // Exact match
{
return i; // Return the exact player on an exact match
// Otherwise if there are two players:
// Me and MeYou any time you entered Me it would find both
// And never be able to return just Me's id
}
else // Partial match
{
count++;
userid = i;
}
}
}
}
if (count != 1)
{
if (playerid != INVALID_PLAYER_ID)
{
if (count)
{
format(string, sizeof(string), "%s Found In Multiple Names, Please Be More Specific.",text);
if (playerid == -1)
{
//IRC_Say(gBotID, IRC_CHANNEL, string);
}else{
SendClientMessage(playerid, COLOR_ERROR, string);
}
//SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow earch");
}
else
{
//SendClientMessage(playerid, 0xFF0000AA, "No matching user found");
format(string, 256, "%s Is Not A Valid Player.", text);
if (playerid == -1)
{
//IRC_Say(gBotID, IRC_CHANNEL, string);
}else{
SendClientMessage(playerid, COLOR_ERROR, string);
}
}
userid = INVALID_PLAYER_ID;
}
userid = INVALID_PLAYER_ID;
}
return userid; // INVALID_USER_ID for bad return
}
rutger177 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-29-2014 , 07:13   Re: error 035: argument type mismatch (argument 1)
Reply With Quote #4

Is tmp supposed to be a String or an Array? Either way, you are using strtok incorrectly
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode