Help me [+rep]
#2

Hello!

Do it like this:
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    
dcmd(login,5,cmdtext);
    
dcmd(setlevel8cmdtext);
    
dcmd(ban3cmdtext);
    
dcmd(freeze6cmdtext);
    
dcmd(unfreeze8cmdtext);
    
dcmd(kick4cmdtext);
    
dcmd(sgod4cmdtext);
    
dcmd(god3cmdtext);
    
dcmd(explode7,cmdtext);
    
dcmd(acmds,5,cmdtext);
    
dcmd(akill,5,cmdtext);
    
dcmd(jetpack,7,cmdtext);
    
dcmd(disarm,6,cmdtext);
    
dcmd(eject,5,cmdtext);
    
dcmd(repair,6,cmdtext);
    
dcmd(spec,4,cmdtext);
    
dcmd(specoff,7,cmdtext);
    
dcmd(pm,2,cmdtext);
    
dcmd(cargod,6,cmdtext);
    
dcmd(kill,4,cmdtext);
    
dcmd(aheal,5,cmdtext);
    
dcmd(givecash,8,cmdtext);
    
dcmd(gc,2,cmdtext);
    
dcmd(admins,6,cmdtext);
    
dcmd(goto,4,cmdtext);
    
dcmd(get,3,cmdtext);
    
dcmd(setcash,7,cmdtext);
    
dcmd(setname,7,cmdtext);
    new 
cmd[256], idx;
    
cmd strtok(cmdtextidx);
    
dcmd(register,8,cmdtext);
    if (
strcmp("/help"cmdtexttrue4) == 0)
    {
        
SendClientMessage(playerid,COLOR_RED,"This is an DeathMatch gamemode.");
        
SendClientMessage(playerid,COLOR_RED,"Your goal is to kill other players and get score and money");
        
SendClientMessage(playerid,COLOR_GREEN,"Register at our website : changeme");
        
SendClientMessage(playerid,COLOR_BLUE,"To see list of commands use /cmds ");
        return 
1;
    }
    if (
strcmp("/kill"cmdtexttrue4) == 0)
    {
        
SetPlayerHealth(playerid0);
        return 
1;
    }
    if (
strcmp("/heal"cmdtexttrue7) == 0)
    {
        if(
GetPlayerMoney(playerid) < 1000) return SendClientMessage(playeridCOLOR_RED"ERROR : You dont have enough money!");
        {
            
GivePlayerMoney(playerid, -1000);
            
SetPlayerHealth(playerid,100);
        }
        return 
1;
    }
    if (
strcmp("/cmds"cmdtexttrue4) == 0)
    {
        
SendClientMessage(playerid,COLOR_RED,"---------------------Commands----------------------");
        
SendClientMessage(playerid,COLOR_RED,"Current commands are:");
        
SendClientMessage(playerid,COLOR_GREEN," /kill /help /heal");
        
SendClientMessage(playerid,COLOR_BLUE,"/sf / lv /ls ");
        return 
1;
    }
    if (
strcmp("/sf"cmdtexttrue2) == 0)
    {
        
SetPlayerPos(playerid,-2039.7689,135.6302,28.8359);
        
SetPlayerVirtualWorld(playerid0);
        
SendClientMessage(playerid0x00FFFFAA"You have been teleported to San Fierro.");
        return 
1;
    }
    if (
strcmp("/ls"cmdtexttrue2) == 0)
    {
        
SetPlayerPos(playerid,2490.6665,-1669.7076,13.3359);
        
SetPlayerVirtualWorld(playerid0);
        
SendClientMessage(playerid0x00FFFFAA"You have been teleported to Los Santos.");
        return 
1;
     }
    if (
strcmp("/lv"cmdtexttrue2) == 0)
    {
        
SetPlayerPos(playerid,1907.0464,960.0598,10.8203);
        
SetPlayerVirtualWorld(playerid0);
        
SendClientMessage(playerid0x00FFFFAA"You have been teleported to Las Venturas.");
        return 
1;
     }
    if (
strcmp("/RDM"cmdtexttrue3) == 0)
    {
        
SetPlayerPos(playerid,-1285.1356,458.6940,7.1875);
        
SetPlayerVirtualWorld(playerid1337);
        
ResetPlayerWeapons(playerid);
        
GivePlayerWeapon(playerid2899999);
        
GivePlayerWeapon(playerid2699999);
        
SendClientMessage(playerid0x00FFFFAA"Welcome to Runnies DeathMatch zone.To quit use /cancel.");
        return 
1;
    }
    if (
strcmp("/WDM"cmdtexttrue3) == 0)
    {
        
SetPlayerPos(playerid,-1285.1356,458.6940,7.1875);
        
SetPlayerVirtualWorld(playerid1338);
        
ResetPlayerWeapons(playerid);
        
GivePlayerWeapon(playerid2499999);
        
GivePlayerWeapon(playerid2799999);
        
GivePlayerWeapon(playerid2999999);
        
GivePlayerWeapon(playerid3199999);
        
SendClientMessage(playerid0x00FFFFAA"Welcome to Walkies DeathMatch zone.To quit use /cancel.");
        return 
1;
    }
    if (
strcmp("/cancel"cmdtexttrue5) == 0)
    {
        
SetPlayerVirtualWorld(playerid0);
        
SetPlayerHealth(playerid0);
        return 
1;
    }
    if (
strcmp("/shoot"cmdtexttrue10) == 0)
    {
        
SetPlayerPos(playerid1457.7526,-1062.9589,213.3828);
        
SendClientMessage(playeridCOLOR_RED "Ready To Shoot!");
        
GivePlayerWeapon(playerid319999);
        
SetPlayerHealth(playerid100);
        
SetPlayerArmour(playerid100);
        return 
1;
    }
    return 
0;

You can see how I put it in this gamemode. Next time I think you will know how you have to do it.
Reply


Messages In This Thread
Help me [+rep] - by blackturboc - 01.07.2016, 08:33
Re: Help me [+rep] - by Mencent - 01.07.2016, 08:55
Re: Help me [+rep] - by xTURBOx - 01.07.2016, 09:02
Re: Help me [+rep] - by Owen007 - 01.07.2016, 09:53

Forum Jump:


Users browsing this thread: 1 Guest(s)