Script Request Thread #5

Hello i need a Vehicle plate script.
Its like this
Player writes /plate [plate number] for example /plate i am pro
And that shows on car
And when server restarts server saves the plate.
So that plate can be changed only when someone change it!

Big thanks and rep + for that who will make this!
Reply

This is only the /plate command.
pawn Code:
CMD:plate(playerid, o[])
{
    new Float:x,Float:y,Float:z,Float:ang;
    GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
    GetVehicleZAngle(GetPlayerVehicleID(playerid),ang);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: You're not in a vehicle!");
    ShowPlayerDialog(playerid,2500,DIALOG_STYLE_INPUT,"Vehicle Plate","Input your new vehicle plate below.","Yes","Cancel");
    return 1;
}
pawn Code:
// OnDialogRespone
if(dialogid == 2500) {
    if(response) {
        new Float:x,Float:y,Float:z,Float:ang;
        SetVehicleNumberPlate(GetPlayerVehicleID(playerid), inputtext);
        GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
        GetVehicleZAngle(GetPlayerVehicleID(playerid),ang);
        SetVehicleToRespawn(GetPlayerVehicleID(playerid));
        SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
        PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid),0);
        SetVehicleZAngle(GetPlayerVehicleID(playerid),ang);
    }
}
Reply

Use this.
Reply

It could be good if i wasnt with dialogs, but thanks...
KoczkaHUN, so there it saves the plate right?
Reply

Quote:
Originally Posted by English-Conceptz
View Post
Hi guys and girls i have a request and hope someone can help, im still a noob around here so please try to give me more than an explanation, the code would be immense tbh.
Ok so i have this:

NOTE THIS ISNT PHP, I JUST USE THE TAGS TO COLOURS SHOW UP
PHP Code:
#include <a_samp>
#define COLOR_DARKGOLD 0x808000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
new TruckerJob[256];
public 
OnFilterScriptInit()
{
    
AddStaticVehicle(403,2057.3081,-1939.9397,13.9432,270.4501,6,6); //  Truck (Spawn Front)
    
AddStaticVehicle(591,2045.2939,-1939.9041,13.0633,268.2366,6,6); //  Trailer (Spawn Back)
    
AddStaticVehicle(403,2032.4635,-1939.7537,13.9389,271.0817,6,6); //  Truck (Spawn Front)
    
AddStaticVehicle(591,2020.9797,-1940.1196,13.9476,270.5276,6,6); //  Trailer (Spawn Back)
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/job trucker"cmdtexttrue10) == 0)
    {
        if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
        {
            if(!
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))){ SendClientMessage(playerid,COLOR_RED,"* You don't have a trailer attached to the vehicle!"); return 1; }
            if(
TruckerJob[playerid] != && TruckerJob[playerid] != && TruckerJob[playerid] != 3){ TruckerJob[playerid] = 1; }
            new 
name[MAX_PLAYER_NAME], string[48];
            
GetPlayerName(playeridnamesizeof(name));
            
format(stringsizeof(string), "* %s is now a Trucker."name );
            
SendClientMessageToAll(COLOR_YELLOWstring);
    
// TRUCKER JOB #1
            
if(TruckerJob[playerid] == 1){
                
TruckerJob[playerid] = 2;
                
SetPlayerCheckpoint(playerid,1337.8055,-870.5533,39.3027,10);
                
SendClientMessage(playeridCOLOR_RED"Deliver food supplies to Roboi's Food Mart");
                return 
1;
            }
    
// TRUCKER JOB #2
            
if(TruckerJob[playerid] == 2){
                
TruckerJob[playerid] = 3;
                
SetPlayerCheckpoint(playerid,1003.4263,-941.8485,41.8079,10);
                return 
1;
            }
    
// TRUCKER JOB #3
            
if(TruckerJob[playerid] == 3){
                
TruckerJob[playerid] = 1;
                
SetPlayerCheckpoint(playerid,-97.8173,-1166.7585,2.2650,10);
                return 
1;
            }
            return 
1;
        }
        
SendClientMessage(playeridCOLOR_RED,"You have to be in a Truck cab to start the job");
    }
    return 
0;
}
public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
     if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
     {
         
SendClientMessage(playeridCOLOR_RED"* You can start Trucking by typing /job trucker");
     }
     return 
0;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
     if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
     {
        if(!
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))){ SendClientMessage(playerid,COLOR_RED,"* You don't have a trailer attached to the vehicle!"); DisablePlayerCheckpoint(playerid); return 1; }
        
GivePlayerMoney(playerid,500);
        
SendClientMessage(playerid,COLOR_YELLOW,"* You have earned $500!");
        
DisablePlayerCheckpoint(playerid);
     }
     return 
1;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
    if(
TruckerJob[playerid] > 0)
    {
        
SendClientMessage(playeridCOLOR_RED"* You have left your job, you won't be payed.");
        
DisablePlayerCheckpoint(playerid);
    }

#1
i want to do is re-organise the trucker jobs so that one is picked at random when "/job trucker" command is called. Im also going to add loads more jobs of course i just made 3 for now while ive been testing.

#2
i also need in somewhere when the trailer becomes disconnected during a mission, a client message comes up saying 'Re-connect trailer to continue with mission. Not doing so will result upon failure when checkpoint is reached' and then obviously if the player drives into the checkpoint with out the trailer he gets nothing.

#3 i want the player to go and re-stock supplies to from a warehouse to continue to make deliveries, after say between 5-7 trips (5-7 being picked at random after each time.

#4 i want each mission to flow into the next, at the moment the player has to type the command after each mission =/
still looking for a solid scriptor to help PLEASE...
Reply

Hi i am getting this error when i want to give a spawn message can you help me ?


public OnPlayerSpawn(playerid)
{
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
SetPlayerToTeamColour(playerid);
return 1;
}
if(team[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You are a civillian try to survive the apocalypse");
}
if(team[playerid] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, "You are a zombie try to kill the civillians");
return 1;
}
Getting error at if(team[playerid] == 2) and if(team[playerid] == 1) and return 1; ((invalid function or declaration)) dont know what to replace it with
Reply

@demonarn

You have an extra bracket.

pawn Code:
public OnPlayerSpawn(playerid)
{
    new Random = random( sizeof ( RandomSpawns ) );
    SetPlayerPos(playerid, RandomSpawns[ Random ][ 0 ], RandomSpawns[ Random ][ 1 ], RandomSpawns[ Random ][ 2 ]);
    SetPlayerFacingAngle(playerid, RandomSpawns[ Random ][ 3 ]);
    SetPlayerToTeamColour( playerid );
   
    if ( team[ playerid ] == 1 )
    {
        SendClientMessage( playerid, COLOR_WHITE, "You are a civillian try to survive the apocalypse" );
    }
    if ( team[ playerid ] == 2 )
    {
        SendClientMessage( playerid, COLOR_WHITE, "You are a zombie try to kill the civillians");
    }
    return ( 1 );
}
Reply

ok the errors are gone ((thank you ^^ )) but it doesnt work 0.o does anyone know how i could make it work ?
Reply

Can someone help me create/download a helper system i can add commands by myself but i want that i can use full commands that they are all defined ! just that i have to create commands
Reply

I need a choose function

syntax:
pawn Код:
stock choose(...)
what does it do? Choose a random number from the number listed.
Example:
pawn Код:
printf("%d", choose(5, 2, 9, 12, 10) );
It would randomly print 5, 2, 9, 12 or 10.
ty.
Reply

Quote:
Originally Posted by admantis
Посмотреть сообщение
I need a choose function

syntax:
pawn Код:
stock choose(...)
what does it do? Choose a random number from the number listed.
Example:
pawn Код:
printf("%d", choose(5, 2, 9, 12, 10) );
It would randomly print 5, 2, 9, 12 or 10.
ty.
pawn Код:
choose( ... )
{
    new
        args,
        result
    ;
   
    args = numargs ( );
    result = random ( args * 100 );
   
    return getarg ( result / 100 );
}
Reply

Quote:
Originally Posted by admantis
Посмотреть сообщение
I need a choose function
pawn Код:
printf("%d", choose(5, 2, 9, 12, 10) );
It would randomly print 5, 2, 9, 12 or 10.
ty.
pawn Код:
stock choose(...)
{
    return getarg(random(numargs()));
}
Reply

Hey! Hello well, I dont think its really hard to do but idk:



1st: In fact I need a clan tool Example:

Commands:

/createclan [Clan Name] (Save the name in a file I guess)

/setclanleader [Clan Name] [Playerid] (Tool for admins) return This Clan doesn't exists.

/addclanmember [Clan Name] [Playerid] (Tool for clan leaders & Admins) (The name of the clanmate goes to a list)

If the clan leader is the leader of "KILLERS" and the leader puts "GANG" instead of his clan then send a message like "You must be leader of this clan to manage it."

/removeclanmember [Clan Name] [Playerid] (Tool for clan leaders)

Same as above please.

So...What happens if theres a clan called "KILLERS" and some strange people Killerless joins, Then I want him to be kicked, In fact if the player is not on the list then the player should be kicked.


Thanks.
Mark

PLEASE PM ME!
Reply

Thanks for the function, both of you! I'd give +rep to both however I can't :P but I gave it to KoczkaHUN for making it simple and efficent

Now I need the following script, I tried to make it but i'm bad with textdraws! when you kill a player, the textdraw will show on the screen, slowly zoom in, and 2 second after it shows, fade it out untill it dissapears.Thanks!

Here is the textdraw:
pawn Код:
Textdraw11 = TextDrawCreate(300.000000, 131.000000, "+1");
    TextDrawBackgroundColor(Textdraw11, 255);
    TextDrawFont(Textdraw11, 3);
    TextDrawLetterSize(Textdraw11, 0.329999, 1.100000);
    TextDrawColor(Textdraw11, -1721176833);
    TextDrawSetOutline(Textdraw11, 1);
    TextDrawSetProportional(Textdraw11, 1);
Reply

Hello.I need a pawn Code wich show how to create HQ becouse i have 1 month try it but i cant..i also check videos but didnt work..Can someone help me...or give me a faction hq you create and ill check it and learn
Reply

Hello, I need a /announce Command, Plase. Thanks
Reply

In ZCMD
pawn Код:
COMMAND:announce(playerid, params[])
{
    new text[64], time, style;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only RCON Adminstrator can use this!");
    else if (sscanf(params, "iis[64]", style, time, text)) return SendClientMessage(playerid, -1, "Usage: /announce <style[0-6]> <time in ms> <text>");
    else if (strlen(text) > 64) return SendClientMessage(playerid, -1, "Message too long, please make it with less than 64 letters!");
    else if(style == 2) return SendClientMessage(playerid, -1, "Bug with style 2! Do not use it!");
    else if (style < 0 || style > 6) return SendClientMessage(playerid, -1,"Invalid style");
    else if (time > 20*1000) return SendClientMessage(playerid, -1, "No longer than 20 seconds");
    else {
        GameTextForAll(text, time, style);
    }
    return 1;
}
Reply

Thanks Kostas ! +1
Reply

Quote:
Originally Posted by admantis
Посмотреть сообщение
Thanks for the function, both of you! I'd give +rep to both however I can't :P but I gave it to KoczkaHUN for making it simple and efficent

Now I need the following script, I tried to make it but i'm bad with textdraws! when you kill a player, the textdraw will show on the screen, slowly zoom in, and 2 second after it shows, fade it out untill it dissapears.Thanks!

Here is the textdraw:
pawn Код:
Textdraw11 = TextDrawCreate(300.000000, 131.000000, "+1");
    TextDrawBackgroundColor(Textdraw11, 255);
    TextDrawFont(Textdraw11, 3);
    TextDrawLetterSize(Textdraw11, 0.329999, 1.100000);
    TextDrawColor(Textdraw11, -1721176833);
    TextDrawSetOutline(Textdraw11, 1);
    TextDrawSetProportional(Textdraw11, 1);
I need this script-.
Reply

Okei, I wanna make system, that if You go into Alhambra, then the Radio [url] starts, and everyone listening this music.


Can any1 help me?


[SOLVED]
Reply


Forum Jump:


Users browsing this thread: 15 Guest(s)