Script Request Thread #5

can someone give me a code that say Loading oject,like you going to join a sever it say loading oject
Reply

Quote:
Originally Posted by Pak_halo
View Post
guys i need helper system with this hcmd

/sethelper [id] /unsethelper [id] kick warn afk [TEXT] /helpers to see online helpers
Here you have an example, of how you should do it. The rest of the command, you can do on your own.
pawn Code:
//Somewhere on top of your gamemode, near other global variables
new bool:playerHelper[MAX_PLAYERS];

CMD:sethelper(playerid, params[])
{
        new pID, str[128];
        if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, -1, "Only admins can use this command.");
   
        if(sscanf(params,"u", pID))
            return SendClientMessage(playerid,-1,"USAGE: /sethelper [PlayerID]");

        if(!IsPlayerConnected(pID))
            return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");

        if(playerHelper[pID])
        return SendClientMessage(playerid, -1, "Selected player is a helper already.");

    new name[MAX_PLAYER_NAME+1], pName[MAX_PLAYER_NAME+1];
        GetPlayerName(pID, name, sizeof name);
    GetPlayerName(playerid, pName, sizeof pName);
    playerHelper[pID] = true;
    format(str, sizeof str, "Admin %s made you a helper.", pName);
    SendClientMessage(pID, -1, str);
    format(str, sizeof str, "You made %s a helper.", name);
    SendClientMessage(playerid, -1, str);
        return 1;
}  
CMD:unsethelper(playerid, params[])
{
        new pID, str[128];
        if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, -1, "Only admins can use this command.");
   
        if(sscanf(params,"u", pID))
            return SendClientMessage(playerid,-1,"USAGE: /unsethelper [PlayerID]");

        if(!IsPlayerConnected(pID))
            return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");

        if(!playerHelper[pID])
        return SendClientMessage(playerid, -1, "Selected player is not helper.");

    new name[MAX_PLAYER_NAME+1], pName[MAX_PLAYER_NAME+1];
        GetPlayerName(pID, name, sizeof name);
    GetPlayerName(playerid, pName, sizeof pName);
    playerHelper[pID] = false;
    format(str, sizeof str, "Admin %s made you a regular player.", pName);
    SendClientMessage(pID, -1, str);
    format(str, sizeof str, "You made %s a regular player.", name);
    SendClientMessage(playerid, -1, str);
        return 1;
}
CMD:hkick(playerid, params[])
{
        new pID, str[128];
        if(!playerHelper[playerid])
        return SendClientMessage(playerid, -1, "Only helpers can use this command.");
   
        if(sscanf(params,"u", pID))
            return SendClientMessage(playerid,-1,"USAGE: /hkick [PlayerID]");

        if(!IsPlayerConnected(pID))
            return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");

        if(playerHelper[pID])
        return SendClientMessage(playerid, -1, "Selected player is a helper too, you can't kick him / her.");

    new name[MAX_PLAYER_NAME+1], pName[MAX_PLAYER_NAME+1];
        GetPlayerName(pID, name, sizeof name);
    GetPlayerName(playerid, pName, sizeof pName);
    format(str, sizeof str, "Helper %s kicked you.", pName);
    SendClientMessage(pID, -1, str);
    format(str, sizeof str, "You kicked %s.", name);
    SendClientMessage(playerid, -1, str);\
    format(str, sizeof str, "Helper %s kicked player %s.", pName, name);
    SendClientMessageToAll(-1, str);
    Kick(pID);
        return 1;
}


---------------------------------------------------------------------------------



Quote:
Originally Posted by karam jaber
View Post
please i need something easy....
i need if players was DMING
like that
Player X Weapon Player Y >>>> like that


please please please make it i need it fast...
Here's the link, mentioned by Southclaw.
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    return 1;
}


---------------------------------------------------------------------------------




Quote:
Originally Posted by DerickClark
View Post
can someone give me a code that say Loading oject,like you going to join a sever it say loading oject
I give you an example, on how you should do it... I used OnPlayerSpawn callback but that's not the best solution for your request. You can either use OnPlayerInteriorChange callback if you want to freeze a player when he enters an interior.

pawn Code:
public OnPlayerSpawn(playerid)
{
    TogglePlayerControllable(playerid, false);
    GameTextForPlayer(playerid, "~w~Loading objects, please wait.", 3000, 3);
    SetTimerEx("Unfreeze", 3000, false, "i", playerid);
        return 1;
}

forward Unfreeze(playerid);
public Unfreeze(playerid)
{
    TogglePlayerControllable(playerid, true);
    SendClientMessage(playerid, -1, "Objects loaded, you can now move again.");
    return 1;
}
Reply

Forget it.
Reply

someone have a /helper to see who the helpers are?
Reply

pawn Code:
CMD:helpers(playerid, params[])
{
    new count = 0, str[40], name[MAX_PLAYER_NAME+1];
    SendClientMessage(playerid, -1, "Helpers ONLINE:");
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(playerHelper[i] == true)
        {
            GetPlayerName(i, name, sizeof name);
            format(str, sizeof str, "Helper %s", name);
            SendClientMessage(playerid, -1, str);
            count ++;
        }  
    }
    if(count == 0) SendClientMessage(playerid, -1, "There are no helpers ONLINE at the moment.");
    return 1;
}
Reply

Quote:
Originally Posted by antonio112
View Post
pawn Code:
CMD:helpers(playerid, params[])
{
    new count = 0, str[40], name[MAX_PLAYER_NAME+1];
    SendClientMessage(playerid, -1, "Helpers ONLINE:");
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(playerHelper[i] == true)
        {
            GetPlayerName(i, name, sizeof name);
            format(str, sizeof str, "Helper %s", name);
            SendClientMessage(playerid, -1, str);
            count ++;
        }  
    }
    if(count == 0) SendClientMessage(playerid, -1, "There are no helpers ONLINE at the moment.");
    return 1;
}
ty for the /helper
Reply

Quote:
Originally Posted by DerickClark
View Post
ty for the /helper
You're welcome. You have on the previous page the rest of the request script...
Reply

Quote:
Originally Posted by antonio112
View Post
You're welcome. You have on the previous page the rest of the request script...
can i save it under scriptfiles? go to a player acc
Helper 0
Reply

someone can a /setping command
Reply

Is it possible to make rustler bombs, whne we press alt they release and when hit ground = explode.
Player should also get kill!
Reply

Hi I need commands /givemoney and /sethealth the first one yo give $ to a player being admin and the other one to give health to a player hooo and please use strcmp command processor. Thank you!
Reply

Quote:
Originally Posted by Lauder
View Post
Hi I need commands /givemoney and /sethealth the first one yo give $ to a player being admin and the other one to give health to a player hooo and please use strcmp command processor. Thank you!
Here you Go. For /givemoney. Enjoy!
PHP Code:
CMD:givemoney(playeridparams[])
{
    new 
targetid,type,string[128];
    if(
sscanf(params"ui"targetidtype)) return SendClientMessage(playeridCOLOR_GRAD2"USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_GREY"* This player is not in server..");
    if(
type || type 99999999) return SendClientMessage(playeridCOLOR_GREY"* Cannot go under 0 or above 99999999.");
    if(
PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playeridCOLOR_GRAD1"You are not ADMIN!");
    
GivePlayerCash(targetidtype);
    
format(stringsizeof(string),"AdmCmd: %s give player %s %d SAK"RPNameplayerid ), RPNametargetid ), type);
    
SendAdminMessage(COLOR_YELLOW,string);
    return 
1;

Enjoy!
Rep if i helped you
Reply

Hello someone can make me afk like pr-rp
when you press esc its make on you 3dtext and write how mach time you are on afk ! please !
Reply

Quote:
Originally Posted by bathushan
View Post
Here you Go. For /givemoney. Enjoy!
PHP Code:
CMD:givemoney(playeridparams[])
{
    new 
targetid,type,string[128];
    if(
sscanf(params"ui"targetidtype)) return SendClientMessage(playeridCOLOR_GRAD2"USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_GREY"* This player is not in server..");
    if(
type || type 99999999) return SendClientMessage(playeridCOLOR_GREY"* Cannot go under 0 or above 99999999.");
    if(
PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playeridCOLOR_GRAD1"You are not ADMIN!");
    
GivePlayerCash(targetidtype);
    
format(stringsizeof(string),"AdmCmd: %s give player %s %d SAK"RPNameplayerid ), RPNametargetid ), type);
    
SendAdminMessage(COLOR_YELLOW,string);
    return 
1;

Enjoy!
Rep if i helped you
Thanks (+rep). how can I convert it into an strcmp command? Thank you.
Reply

Quote:
Originally Posted by Lauder
View Post
Thanks (+rep). how can I convert it into an strcmp command? Thank you.
strcmp and sscanf don't work to good.
Reply

Quote:
Originally Posted by bathusin2343858
Here you Go. For /givemoney. Enjoy!
PHP Code:
CMD:givemoney(playeridparams[])
{
    new 
targetid,type,string[128];
    if(
sscanf(params"ui"targetidtype)) return SendClientMessage(playeridCOLOR_GRAD2"USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_GREY"* This player is not in server..");
    if(
type || type 99999999) return SendClientMessage(playeridCOLOR_GREY"* Cannot go under 0 or above 99999999.");
    if(
PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playeridCOLOR_GRAD1"You are not ADMIN!");
    
GivePlayerCash(targetidtype);
    
format(stringsizeof(string),"AdmCmd: %s give player %s %d SAK"RPNameplayerid ), RPNametargetid ), type);
    
SendAdminMessage(COLOR_YELLOW,string);
    return 
1;

Enjoy!
Rep if i helped you
How do I make this into a strcmp command?
Reply

Quote:
Originally Posted by Lauder
View Post
How do I make this into a strcmp command?
For first, why do you want to change that, ZCMD is more faster than strcmp..
Whatever..

You need this function:
pawn Code:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
 
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Add this to the OnPlayerCommandText callback(at the beginning of the callback):
pawn Code:
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
The command would be like this:
pawn Code:
if(!strcmp(cmd, "/givemoney", true))
{
    new tmp[128], targetid, type, string[128];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    targetid = strval( tmp );
   
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    type = strtok(cmdtext, idx);

    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* This player is not in server..");
    if(type < 0 || type > 99999999) return SendClientMessage(playerid, COLOR_GREY, "* Cannot go under 0 or above 99999999.");
    if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GRAD1, "You are not ADMIN!");
   
    GivePlayerCash(targetid, type);
    format(string, sizeof(string),"AdmCmd: %s give player %s %d SAK", RPName( playerid ), RPName( targetid ), type);
    SendAdminMessage(COLOR_YELLOW,string);
    return 1;
}
Quote:
Originally Posted by Biess
View Post
I need a ZCMD jail and unjail command with timer.
Use this: https://sampforum.blast.hk/showthread.php?tid=143977
Reply

Quote:
Originally Posted by Roach_
View Post
For first, why do you want to change that, ZCMD is more faster than strcmp..
Whatever..

You need this function:
pawn Code:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
 
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Where do I add it?
Reply

i need save and load cash code
Reply

need an eject command eg: /eject [ID]
Reply


Forum Jump:


Users browsing this thread: 17 Guest(s)