SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 05/02/2011, 12:51 AM   #1
showarn
Big Clucker
 
Join Date: Aug 2010
Location: sweden
Posts: 149
Reputation: -8
Default Convert from dcmd to strcmp [Help me]

Hello could some1 help me convert this script for me cuz aint working;S i think the problem is "dcmd"


here is the script

Code:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Code:
dcmd(wantedlvl, 9, cmdtext);

Code:
dcmd_wantedlvl(playerid, params[])
{
    if(gTeam[playerid] == TEAM_BLUE)
    {
        new targetid, wanted, reason;

        if(sscanf(params, "udz", targetid, wanted, reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setwanted (id) (wanted-level) (reason)");
        else if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid ID");
        else if(wanted < 7)
        {
            new playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], string[256];
            GetPlayerName(playerid, playername, sizeof(playername));
            GetPlayerName(targetid, targetname, sizeof(targetname));

            SetPlayerWantedLevel(targetid, wanted);
            
            format(string, sizeof(string), "%s(%d) has set your wanted to %d because %s", playername, playerid, wanted, reason);
            SendClientMessage(targetid, COLOR_LIGHTGREEN, string);
            
            format(string, sizeof(string), "You has set %s(%d) wanted to %d because %s", targetname, targetid, wanted, reason);
            SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
            return 1;
        }
        else SendClientMessage(playerid, COLOR_RED,"USAGE: Minimum 0 || Maximum 6");
        return 1;
    }
    return 0;
}

if any1 understand these terms please help me !
showarn is offline  
Old 05/02/2011, 12:52 AM   #2
admantis
High-roller
 
Join Date: Sep 2009
Posts: 2,528
Reputation: 449
Default Re: Convert from dcmd to strcmp [Help me]

You really don't want to do it. Use dcmd and sscanf, it's like x20 easier.
admantis is offline  
Old 05/02/2011, 12:57 AM   #3
showarn
Big Clucker
 
Join Date: Aug 2010
Location: sweden
Posts: 149
Reputation: -8
Default Re: Convert from dcmd to strcmp [Help me]

ye but i got sscanf and this script dosnt work for me i dno why
showarn is offline  
Old 05/02/2011, 01:04 AM   #4
r3k1lLz_
Big Clucker
 
Join Date: Jan 2010
Location: 127.0.0.1
Posts: 89
Reputation: 0
Default Re: Convert from dcmd to strcmp [Help me]

Why would you want to change dcmd to strcmp that is the dumbest idea I've ever heard...
__________________
Code:
Filterscripts			     Maps                      Functions/Includes
Vote System	 	                                       Easy Helpbot
ChangeMyColour
r3k1lLz_ is offline  
Old 05/02/2011, 01:05 AM   #5
showarn
Big Clucker
 
Join Date: Aug 2010
Location: sweden
Posts: 149
Reputation: -8
Default Re: Convert from dcmd to strcmp [Help me]

okey i dno iam learning i dont now a shit about scripting atm Readed some guides etc but aint readed bout this anything wrong with my script why dosnt it work ?
showarn is offline  
Old 05/02/2011, 01:41 AM   #6
Unknown123
Guest
 
Posts: n/a
Default Re: Convert from dcmd to strcmp [Help me]

His whole gamemode is based on "strcmp"
And when he added the "dcmd" command then the command didnt work...

I dont know the problem but..
 
 

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert strtok and strcmp to sscanf and zcmd admantis Help Archive 5 21/01/2011 05:39 AM
Dcmd to Strcmp [UG]Scripter Help Archive 5 04/09/2010 10:43 AM
dcmd vs scanff vs strcmp ? gamer931215 Help Archive 20 17/08/2010 11:31 AM
[SOLVED] /veh command with vehiclename or vehid in dcmd (from strcmp to dcmd) KnooL Help Archive 9 01/01/2010 04:59 AM
Can i use dcmd and strcmp together? Jimmy1 Help Archive 1 24/06/2009 03:09 PM


All times are GMT. The time now is 08:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.