Script Request Thread #6
#1

Alright, seems like the fifth thread was getting too full once again, so here we go with a new thread.

This thread is for people to post gamemode and filterscript ideas, in an effort to find people willing to help them make it. Please keep all requests to this thread, and do NOT flame or bump!


Script request archive:

Script Request Thread #5 (don't bother searching anything here, it will be a waste of time)

Script Request Thread #4

Script Request Thread #3

Script Request Thread #2

Script Request Thread #1
Reply
#2

First !! I need a derby system, that when a player enters the derby, the limit is 4 (i have 4 cars) and if 4 are in the derby no-one else can join, the last on in the derby gets 10k and the cars will respawn. And it starts again.

Heres my zcmd :

Code:
CMD:derby(playerid, params[])
{
    new str7[128], player8[MAX_PLAYER_NAME];
    GetPlayerName(playerid, player8, sizeof(player8));
    format(str7,sizeof(str7),"%s teleportis end derbysse [/derby]",player8);
    SendClientMessageToAll(COLOR_GREEN,str7);
    new rand = random(sizeof(D1Rand));
    SetPlayerPos(playerid, D1Rand[rand][0], D1Rand[rand][1], D1Rand[rand][2]);
    SendClientMessage(playerid, COLOR_NGREEN,"Teleportisid end derbysse!");
    ResetPlayerWeapons(playerid);
    nocmd[playerid] = 1;
    return 1;
}
Reply
#3

i need a /setping. /setping (How Much Max)
Reply
#4

I want a command that when I type /car, an Infernus will be spawned and I will be put inside it right away.

Optional: A message in the chat saying "You have successfully spawned an infernus."

Thank you.
Reply
#5

Quote:
Originally Posted by Vytixz
View Post
I want a command that when I type /car, an Infernus will be spawned and I will be put inside it right away.

Optional: A message in the chat saying "You have successfully spawned an infernus."

Thank you.
Here's your command in ZCMD:
pawn Code:
//Somewhere on top of your script, under #includes
new CarSpawned[MAX_PLAYERS];

CMD:car(playerid, params[])
{
    #pragma unused params
    if(CarSpawned[playerid] > 0)
        DestroyVehicle(CarSpawned[playerid]);

    new Float: Pos[4];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    GetPlayerFacingAngle(playerid, Pos[3]);
    CarSpawned[playerid] = CreateVehicle(411, Pos[0], Pos[1], Pos[2], Pos[3], 1, 1, 0);
    PutPlayerInVehicle(playerid, CarSpawned[playerid], 0);
    SendClientMessage(playerid, -1, "You have successfully spawned an Infernus.");
    return 1;
}


Quote:
Originally Posted by DerickClark
View Post
i need a /setping. /setping (How Much Max)
Not sure if I understood your request. If I'm not wrong, you want a ping limit and if a player reaches that ping, he'll get kicked ... Well, here it is:
pawn Code:
//Somewhere on top of your script, under #includes
new MaxPing = 500;

CMD:setping(playerid, params[])
{
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, -1, "You're not allowed to use this command.");

    new ping, str[65], name[MAX_PLAYER_NAME];
    if(sscanf(params, "i", ping))
        return SendClientMessage(playerid, -1, "USAGE: /setping [MAX PING]");

    if(ping < 20 || ping > 1000)
         return SendClientMessage(playerid, -1, "Use real values, between 20 and 1000");

     GetPlayerName(playerid, name, sizeof name);
     MaxPing = ping;
     format(str, sizeof str, "Admin %s set the max ping to %i.", name, MaxPing);
     SendClientMessageToAll(-1, str);
     return 1;
}

//And now, under OnPlayerUpdate callback;

public OnPlayerUpdate(playerid)
{
    if(GetPlayerPing(playerid) > MaxPing) Kick(playerid);
    return 1;
}
If this is not what you asked for, please let me know ...
Reply
#6

Need help with a command if possible, /vx carname, example, i do /vx sultan, it spawns a sultan and puts me in it.

Thanks.
Reply
#7

I need a detain command that places said id into the last car you was in (Must be close to the car and person though) the command I would like is to be /detain [thereid] [seatid] I would prefer the command script to be in ZCMD. This won't be used as a police faction only command therefore I want it so everyone can use it.

Thank you.
Reply
#8

I'm looking for a /warn with 1/3
+
/Kick
Reply
#9

Quote:
Originally Posted by DerickClark
View Post
I'm looking for a /warn with 1/3
+
/Kick
pawn Code:
//On top of your script, under #includes

new playerWarn[MAX_PLAYERS];

CMD:warn(playerid, params[])
{
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, -1, "Only admins can use this command.");

    new pID, str[128], pName[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
    if(sscanf(params, "u", pID))
        return SendClientMessage(playerid, -1, "Usage: /warn [Player ID]");

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

    playerWarn[pID] ++;
    GetPlayerName(playerid, pName, sizeof pName);
    GetPlayername(pID, name, sizeof name);
    format(str, sizeof str, "Admin %s warned you. Total warnings %i.", pName, playerWarn[pID]);
    SendClientMessage(pID, -1, str);
    format(str, sizoef str, "You warned player %s. Total warnings %i.", name, playerWarn[pID]);
    SendClientMessage(playerid, -1, str);
    if(playerWarn[pID] > 2)
    {
         format(str, sizeof str, "%s accumulated 3 warnings and got kicked from the server.", name);
         SendClientMessageToAll(-1, str);
         SendClientMessage(pID, -1, "You were warned three (3) times and got kicked.");
         Kick(pID);
    }
    return 1;
}    

CMD:kick(playerid, params[])
{
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, -1, "Only admins can use this command.");

    new pID, str[128], pName[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
    if(sscanf(params, "u", pID))
        return SendClientMessage(playerid, -1, "Usage: /kick [Player ID]");

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

    GetPlayerName(playerid, pName, sizeof pName);
    GetPlayerName(pID, name, sizeof name);
    format(str, sizeof str, "You kicked player %s.", name);
    SendClientMessage(playerid, -1, str);
    format(str, sizeof str, "Admin %s kicked you.", pName);
    SendClientMessage(pID, -1, str);
    format(str, sizeof str, "Admin %s kicked player %s.", pName, name);
    SendClientMessageToAll(-1, str);
    Kick(pID);
    return 1;
}





Quote:
Originally Posted by total3clipse
View Post
I need a detain command that places said id into the last car you was in (Must be close to the car and person though) the command I would like is to be /detain [thereid] [seatid] I would prefer the command script to be in ZCMD. This won't be used as a police faction only command therefore I want it so everyone can use it.

Thank you.
pawn Code:
//On top of your script

new LastCar[MAX_PLAYERS];

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
        LastCar[playerid] == GetPlayerVehicleID(playerid);
    return 1;
}

CMD:detain(playerid, params[])
{
    if(LastCar[playerid] < 1)
         return SendClientMessage(playerid, -1, "You haven't entered a vehicle, as a driver yet.");

    new Float: vehPos[3], Float: Pos[3], pID, str[128], seatid, pName[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
    if(sscanf(params, "ui", pID, seatid))
         return SendClientMessage(playerid, -1, "Usage: /detain [Player ID] [Seat (1-3)]");

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

    if(seatid < 1 || seatid > 3)
         return SendClientMessage(playerid, -1, "Invalid seat ID. Use values between 1 and 3");

    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    if(!IsPlayerInRangeOfPoint(pID, 5.0, Pos[0], Pos[1], Pos[2]))
         return SendClientMessage(playerid, -1, "Selected player is not close enough.");

    GetVehiclePos(LastCar[playerid], vehPos[0], vehPos[1], vehPos[2]);
    if(!IsPlayerInRangeOfPoint(playerid, 10.0, vehPos[0], vehPos[1], vehPos[2]))
         return SendClientMessage(playerid, -1, "You're not near the last vehicle.");

    GetPlayerName(playerid, pName, sizeof pName);
    GetPlayerName(pID, name, sizeof name);
    format(str, sizeof str, "You detained %s in the vehicle ID %i, seat %i.", name, LastCar[playerid], seatid);
    SendClientMessage(playerid, -1, str);
    format(str, sizeof str, "You've been detained by %s in vehicle ID %i, seat %i.", pName, LastCar[playerid], seatid);
    SendClientMessage(pID, -1, str);
    PutPlayerInVehicle(pID, LastCar[playerid], seatid);
    return 1;
}
Reply
#10

Quote:
Originally Posted by Hade.
View Post
First !! I need a derby system, that when a player enters the derby, the limit is 4 (i have 4 cars) and if 4 are in the derby no-one else can join, the last on in the derby gets 10k and the cars will respawn. And it starts again.

Heres my zcmd :

Code:
CMD:derby(playerid, params[])
{
    new str7[128], player8[MAX_PLAYER_NAME];
    GetPlayerName(playerid, player8, sizeof(player8));
    format(str7,sizeof(str7),"%s teleportis end derbysse [/derby]",player8);
    SendClientMessageToAll(COLOR_GREEN,str7);
    new rand = random(sizeof(D1Rand));
    SetPlayerPos(playerid, D1Rand[rand][0], D1Rand[rand][1], D1Rand[rand][2]);
    SendClientMessage(playerid, COLOR_NGREEN,"Teleportisid end derbysse!");
    ResetPlayerWeapons(playerid);
    nocmd[playerid] = 1;
    return 1;
}
OMG i was the first poster, and no help still? I waited like 1 week for this :S
Reply
#11

Quote:
Originally Posted by antonio112
View Post
pawn Code:
//On top of your script, under #includes

new playerWarn[MAX_PLAYERS];

CMD:warn(playerid, params[])
{
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, -1, "Only admins can use this command.");

    new pID, str[128], pName[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
    if(sscanf(params, "u", pID))
        return SendClientMessage(playerid, -1, "Usage: /warn [Player ID]");

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

    playerWarn[pID] ++;
    GetPlayerName(playerid, pName, sizeof pName);
    GetPlayername(pID, name, sizeof name);
    format(str, sizeof str, "Admin %s warned you. Total warnings %i.", pName, playerWarn[pID]);
    SendClientMessage(pID, -1, str);
    format(str, sizoef str, "You warned player %s. Total warnings %i.", name, playerWarn[pID]);
    SendClientMessage(playerid, -1, str);
    if(playerWarn[pID] > 2)
    {
         format(str, sizeof str, "%s accumulated 3 warnings and got kicked from the server.", name);
         SendClientMessageToAll(-1, str);
         SendClientMessage(pID, -1, "You were warned three (3) times and got kicked.");
         Kick(pID);
    }
    return 1;
}    

CMD:kick(playerid, params[])
{
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, -1, "Only admins can use this command.");

    new pID, str[128], pName[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
    if(sscanf(params, "u", pID))
        return SendClientMessage(playerid, -1, "Usage: /kick [Player ID]");

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

    GetPlayerName(playerid, pName, sizeof pName);
    GetPlayerName(pID, name, sizeof name);
    format(str, sizeof str, "You kicked player %s.", name);
    SendClientMessage(playerid, -1, str);
    format(str, sizeof str, "Admin %s kicked you.", pName);
    SendClientMessage(pID, -1, str);
    format(str, sizeof str, "Admin %s kicked player %s.", pName, name);
    SendClientMessageToAll(-1, str);
    Kick(pID);
    return 1;
}







pawn Code:
//On top of your script

new LastCar[MAX_PLAYERS];

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
        LastCar[playerid] == GetPlayerVehicleID(playerid);
    return 1;
}

CMD:detain(playerid, params[])
{
    if(LastCar[playerid] < 1)
         return SendClientMessage(playerid, -1, "You haven't entered a vehicle, as a driver yet.");

    new Float: vehPos[3], Float: Pos[3], pID, str[128], seatid, pName[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
    if(sscanf(params, "ui", pID, seatid))
         return SendClientMessage(playerid, -1, "Usage: /detain [Player ID] [Seat (1-3)]");

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

    if(seatid < 1 || seatid > 3)
         return SendClientMessage(playerid, -1, "Invalid seat ID. Use values between 1 and 3");

    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    if(!IsPlayerInRangeOfPoint(pID, 5.0, Pos[0], Pos[1], Pos[2]))
         return SendClientMessage(playerid, -1, "Selected player is not close enough.");

    GetVehiclePos(LastCar[playerid], vehPos[0], vehPos[1], vehPos[2]);
    if(!IsPlayerInRangeOfPoint(playerid, 10.0, vehPos[0], vehPos[1], vehPos[2]))
         return SendClientMessage(playerid, -1, "You're not near the last vehicle.");

    GetPlayerName(playerid, pName, sizeof pName);
    GetPlayerName(pID, name, sizeof name);
    format(str, sizeof str, "You detained %s in the vehicle ID %i, seat %i.", name, LastCar[playerid], seatid);
    SendClientMessage(playerid, -1, str);
    format(str, sizeof str, "You've been detained by %s in vehicle ID %i, seat %i.", pName, LastCar[playerid], seatid);
    SendClientMessage(pID, -1, str);
    PutPlayerInVehicle(pID, LastCar[playerid], seatid);
    return 1;
}
I get this error

Code:
C:\Users\winny\Desktop\MGRP\SAMP\Samp server\gamemodes\MG.pwn(529) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Line 529 is
Code:
	LastCar[playerid] == GetPlayerVehicleID(playerid);
Thank you.
Reply
#12

Hi, I've tried to make a Level System, that every time a player kills another in the progress bar goes +1, should be 0/5, but I can't get it right, I already have seen tutorials and used the progress include, but doesn't work for me, can anyone do it for me? I already made the progress bar...
Code:
CreatePlayerProgressBar(playerid, 3.00, 442.00, 634.50, 3.20, 12989183, 100.0);
It will be very kind of someone to help me with this
Reply
#13

i need a /car (with all cars)
Reply
#14

Quote:
Originally Posted by DerickClark
View Post
i need a /car (with all cars)
There are many filterscripts already out there to do that, dialog based anyway.

However, you could try this:

You're going to need ZCMD and sscanf2.

ZCMD: https://sampforum.blast.hk/showthread.php?tid=91354
sscanf2: https://sampforum.blast.hk/showthread.php?tid=120356

Credits to Ryder for the car name array and ReturnVehicleID function.

pawn Code:
//Near the top of your script

new
    vNames[212][] =
    {
        "Landstalker", "Bravura", "Buffalo", "Linerunner", "Pereniel", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
        "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Mr Whoopee", "BF Injection",
        "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
        "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
        "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider",
        "Glendale", "Oceanic", "Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR3 50", "Walton", "Regina",
        "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood",
        "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B",
        "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropdust", "Stunt", "Tanker", "RoadTrain",
        "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune", "Cadrona", "FBI Truck",
        "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent", "Bullet", "Clover",
        "Sadler", "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster A",
        "Monster B", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight", "Trailer",
        "Kart", "Mower", "Duneride", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "Newsvan", "Tug", "Trailer A", "Emperor",
        "Wayfarer", "Euros", "Hotdog", "Club", "Trailer B", "Trailer C", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)",
        "Police Car (LVPD)", "Police Ranger", "Picador", "S.W.A.T. Van", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer A", "Luggage Trailer B",
        "Stair Trailer", "Boxville", "Farm Plow", "Utility Trailer"
    }
;
pawn Code:
//Near the bottom in your script

ReturnVehicleID(vName[])
{
    for(new x; x != 211; x++) if(strfind(vNames[x], vName, true) != -1) return x + 400;
    return INVALID_VEHICLE_ID;
}
pawn Code:
//Command using ZCMD and sscanf.

COMMAND:car(playerid, params[])
{
    new carName[100];
    if(sscanf(params, "s[100]", carName)) return SendClientMessage(playerid, 0xa9c4e4ff, "Usage: /car [name]");
    else if(ReturnVehicleID(carName) == INVALID_VEHICLE_ID) return SendClientMessage(playerid, 0xa9c4e4ff, "Unknown car name!");
    else
    {
        new Float:pPos[4], vid;
        GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
        GetPlayerFacingAngle(playerid, pPos[3]);
        vid = CreateVehicle(ReturnVehicleID(carName), pPos[0], pPos[1], pPos[2] + 1.00, pPos[3], 0, 1, 60);
        PutPlayerInVehicle(playerid, vid, 0);
    }
    return 1;
}
Tested working. If you're going to give me reputation for this, then please also give some to Ryder for his array and function, here: http://forum.sa-mp.com/showpost.php?...13&postcount=7.
Reply
#15

i need a barricade system if i collect some wood i can put barricade with /barricade command
Reply
#16

Hey,
I am looking for vehicle insurance system for roleplay server,can I get some help please ?
Reply
#17

i need a /locksever Command to lock the sever.
Reply
#18

Quote:
Originally Posted by DerickClark
View Post
i need a /locksever Command to lock the sever.
Here

pawn Code:
new bool:ServerLocked;

public OnGameModeInit()
{
    ServerLocked = false;
    return 1;
}

public OnPlayerConnect(playerid)
{
    if(ServerLocked) { Kick(playerid); }
    return 1;
}

COMMAND:lockserver(playerid, params[])
{
    if(ServerLocked)
    {
        ServerLocked = false;
        SendClientMessage(playerid, 0xa9c4e4ff, "Server is no longer locked!");
    }
    else
    {
        ServerLocked = true;
        SendClientMessage(playerid, 0xa9c4e4ff, "Server is now locked!");
    }
    return 1;
}
By the way, did the /car system work for you?
Reply
#19

it work.but it don't lock the sever
like you go to server.cfg you put
password Test
i wanna make it as a command.
i mean the /car work...
Reply
#20

Quote:
Originally Posted by DerickClark
View Post
it work.but it don't lock the sever
You're saying it works but doesn't work? What exactly happens.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)