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

strtok and ReturnUser are really old and slow methods for that. The best option is sscanf.
Same applies for dcmd. ZCMD and y_commands are faster methods.

And all you'd have to do is:
PHP код:
CMD:crimes(playeridparams[])
{
    if (
PlayerInfo[playerid][pSpawn] != 1) return SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command When You're Dead.");
    if (
PlayerInfo[playerid][pTeam] != TEAM_CIVILIAN) return SendClientMessage(playeridCOLOR_ERROR"Only Civilians Can Use This Command.");
    
    new 
giveplayerid;
    if (
isnull(params)) giveplayerid playerid;
    else if (!
sscanf(params"r"giveplayerid))
    {
        if (
giveplayerid == INVALID_PLAYER_ID)
        {
            new 
string[23];
            
format(stringsizeof(string), "%d Is Not A Valid ID."giveplayerid);
            
SendClientMessage(playeridCOLOR_ERRORstring);
            return 
1;
        }
    }
    
    new 
string[100];
    switch (
PlayerInfo[giveplayerid][pWantedLevel])
    {
        case 
0format(stringsizeof(string), "Wated Level %d - Innocent Civilian"PlayerInfo[giveplayerid][pWantedLevel]);
        case 
.. 5format(stringsizeof(string), "~y~Wated Level %d"PlayerInfo[giveplayerid][pWantedLevel]);
        case 
.. 10format(stringsizeof(string), "~r~Wated Level %d"PlayerInfo[giveplayerid][pWantedLevel]);
    }
    
    if(
PlayerCrimeListRowNo[giveplayerid] > 0)
    {
        
        
TextDrawHideForPlayer(playeridMenu_Title[playerid]);
        
TextDrawHideForPlayer(playeridMenu_Stats[playerid]);
        
TextDrawHideForPlayer(playeridMenu_End[playerid]);
        
        for(new 
0MAX_TEXTDRAW_ROWSr++)
        {
            
TextDrawHideForPlayer(playeridMenu_Column1[playerid][r]);
            
TextDrawHideForPlayer(playeridMenu_Column2[playerid][r]);
        }
        
        
ShowTextDrawMenu(playeridTD_MENU_INFO,"~g~Crime History"PlayerCrimeListRowNo[giveplayerid] + 50);
        
//ShowTextDrawMenuItems(playerid, 0, " ", " ", " ",0);
        
        
format(stringsizeof(string), "%s (%d)~n~%s"PlayerInfo[giveplayerid][pName], giveplayeridstring);
        
        
ShowTextDrawMenuItems(playerid0string" "" ",0);
        
ShowTextDrawMenuItems(playerid1" "" "" ",0);
        
ShowTextDrawMenuItems(playerid2" "" "" ",0);
        
ShowTextDrawMenuItems(playerid3" "" "" ",0);
        
//ShowTextDrawMenuItems(playerid, 3, " ", Line[0], LineEx[0],0);
        
ShowTextDrawMenuItems(playerid4" "PlayerCrimeList[playerid][1], " "0);
        
ShowTextDrawMenuItems(playerid5" "PlayerCrimeList[playerid][2], " "0);
        
ShowTextDrawMenuItems(playerid6" "PlayerCrimeList[playerid][3], " "0);
        
ShowTextDrawMenuItems(playerid7" "PlayerCrimeList[playerid][4], " "0);
        
ShowTextDrawMenuItems(playerid8" "PlayerCrimeList[playerid][5], " "0);
        
ShowTextDrawMenuItems(playerid9" "PlayerCrimeList[playerid][6], " "0);
        
ShowTextDrawMenuItems(playerid10" "PlayerCrimeList[playerid][7], " "0);
        
ShowTextDrawMenuItems(playerid11" "PlayerCrimeList[playerid][8], " "0);
        
ShowTextDrawMenuItems(playerid12" "PlayerCrimeList[playerid][9], " "0);
    }
    else
    {
        
format(stringsizeof(string), "No Crimes Committed By %s (%d)."PlayerInfo[giveplayerid][pName], giveplayerid);
        
SendClientMessage(playeridCOLOR_ERRORstring);
    }
    return 
1;

Reply


Messages In This Thread
error 035: argument type mismatch (argument 1) - by sscarface - 25.05.2015, 15:22
Re: error 035: argument type mismatch (argument 1) - by SoFahim - 25.05.2015, 15:36
Re: error 035: argument type mismatch (argument 1) - by Konstantinos - 25.05.2015, 15:46

Forum Jump:


Users browsing this thread: 2 Guest(s)