Script Request Thread #5

Quote:
Originally Posted by Ld Est Ld
View Post
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?
Well you can use IsPlayerInRangeOfPoint and PlayAudioStreamForPlayer
Reply

Could someone make a /say command for me please, even with the public OnPlayerCommandText(playerid, cmdtext[]) bit on it, just everything on it so when I compile it, it will 100% work. I'm not being lazy lol it's one of the simplest thing to make but the simplest things bug the shit out of me because I find it's harder to fix .

Anyways, thanks so much for any help I get.

Stivs.

PS

Say = Light Red text sent to the whole server with 'Admin: (text here)'
Reply

Quote:
Originally Posted by Stivs_Reznock
Посмотреть сообщение
Could someone make a /say command for me please, even with the public OnPlayerCommandText(playerid, cmdtext[]) bit on it, just everything on it so when I compile it, it will 100% work. I'm not being lazy lol it's one of the simplest thing to make but the simplest things bug the shit out of me because I find it's harder to fix .

Anyways, thanks so much for any help I get.

Stivs.

PS

Say = Light Red text sent to the whole server with 'Admin: (text here)'
Sure.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/say", true) == 0)
    {
        if(!IsPlayerAdmin(playerid))
            return 0;
        if((cmdtext[4] != ' ') || (cmdtext[5] == 0))
            return SendClientMessage(playerid, 0xAFAFAFFF, "Usage:{FFFFFF} /say [text]");
        new
            str[135];
        format(str, sizeof(str), "Admin: %s", cmdtext[4]);
        return SendClientMessageToAll(0xFF6347FF, str); // light red
    }
    return 0;
}
Reply

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
Sure.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/say", true) == 0)
    {
        if(!IsPlayerAdmin(playerid))
            return 0;
        if((cmdtext[4] != ' ') || (cmdtext[5] == 0))
            return SendClientMessage(playerid, 0xAFAFAFFF, "Usage:{FFFFFF} /say [text]");
        new
            str[135];
        format(str, sizeof(str), "Admin: %s", cmdtext[4]);
        return SendClientMessageToAll(0xFF6347FF, str); // light red
    }
    return 0;
}
Thanks very much but it comes up with these errors and warnings.

C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandText")
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(3) : error 017: undefined symbol "strcmp"
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(5) : error 017: undefined symbol "IsPlayerAdmin"
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(7) : warning 217: loose indentation
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn( : error 017: undefined symbol "SendClientMessage"
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(9) : warning 217: loose indentation
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(11) : warning 217: loose indentation
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(11) : error 017: undefined symbol "format"
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(11) : warning 202: number of arguments does not match definition
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(11) : warning 202: number of arguments does not match definition
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(11) : warning 202: number of arguments does not match definition
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(12) : error 017: undefined symbol "SendClientMessageToAll"
C:\Users\Stivs\Desktop\Scripting\My Scripts\say.pwn(14) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply

how can i create a function like if a player leaves a point the timer kills
so if i have this
pawn Код:
if (IsPlayerInRangeOfPoint (playerid, 10.0, GasStations[i][gx], GasStations[i][gy], GasStations[i][gz])) return 1;
        }
and it goes out of point range it kills the timer ?
Reply

Hi,i need a command for example /attach3dtexttoplayer [playerid] [text]..tnx
Reply

Hi. I need a couple of commands, quite simple.
Could someone script me a /flip command? (To flip your vehicle, with ZCMD) Also, I could do with a command to change car colours, preferably just /vcol. (i.e. /vcol [Colour 1] [Colour 2]). Thanks in advance!

Oh and this time can I not get a smartass saying that I should know this as I'm a member from 2007, I'm a user not a scripter.
Reply

The /flip command:

pawn Код:
if ( strcmp ( cmdtext , "/flip", true)==0)
            {
                    new State=GetPlayerState(playerid);
                    if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
            {
                    new VehicleID, Float:Angle, Float:X, Float:Y, Float:Z;
                    GetPlayerPos(playerid, X, Y, Z);
                    VehicleID = GetPlayerVehicleID(playerid);
                    GetVehicleZAngle(VehicleID, Angle);
                    SetVehiclePos(VehicleID, X, Y, Z);
                    SetVehicleZAngle(VehicleID, Angle);
                    SendClientMessage(playerid, 0xFFFF00AA, "Your vehicle has been flipped!");
            }
                    return 1;
    }
That's all I know. I hope this helps.
Reply

pawn Код:
CMD:flip(playerid, params[])
{
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000FF, "You are not driving any vehicle.");
    new pvID = GetPlayerVehicleID(playerid), Float:angle;
    GetVehicleZAngle(pvID, angle);
    SetVehicleZAngle(pvID, angle);
    SetVehicleAngularVelocity(pvID, 0.0, 0.0, 0.0);
    SendClientMessage(playerid, 0x00FF00FF, "You have flipped your vehicle.");
    return 1;
}
Reply

I converted the first one myself yesterday forgot to write that I did sorry.
Thanks, I still need a /vcol command (that will change car colours like /vcol [car colour 1] [car colour 2]), if anyone can do that for me too. Thanks. ZCMD is preferable.
Reply

Quote:
Originally Posted by slimshady
Посмотреть сообщение
I converted the first one myself yesterday forgot to write that I did sorry.
Thanks, I still need a /vcol command (that will change car colours like /vcol [car colour 1] [car colour 2]), if anyone can do that for me too. Thanks. ZCMD is preferable.
pawn Код:
CMD:vcol(playerid, params[])
{
    new vehicleid, color1, color2;
    if((vehicleid = GetPlayerVehicleID(playerid))) {
        if(sscanf(params, "dd", color1, color2)) return SendClientMessage(playerid, -1, "Usage: /vcol [car colour 1] [car colour 2]");
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You' re not driver!");
        ChangeVehicleColor(vehicleid, color1, color2);
        SendClientMessage(playerid, -1, "Vehicle Colours have been changed!);
        return 1;
    }
    else return SendClientMessage(playerid, -1, "
You are not in a vehicle!");
}
Reply

doeas anyone know how to make turfs?
Reply

These are not called "turfs" they are called "Gang zones". You can create them by using this tool to make them:
https://sampforum.blast.hk/showthread.php?tid=372
Reply

Can anyone help me please. People seem to be ignoring my posts.


I need a VIP system with the following commands:

/vips - Displays online VIP's (Admin command).
/vipshop - Displays the special weapons that VIP's can use for example
- Rocket Launcher (5 ammo)
- Minigun (200 ammo)
- Grenades (2 ammo)
/viptime - Displays the amount of VIP days they have left.
/vipskin - Allows the player too choose from a selection of skins.
-If the VIP is on the SWAT team, he / she can't choose a Terrorist skin.
-If the VIP is on the Terrorist team, he / she can't choose a SWAT skin.
/vip(chat) - Allows VIP's to chat privately with other online VIP's.
/hat - Allows a VIP to wear a hat.
/glasses - Allows a VIP to wear glasses.
/viptext - Allows a VIP to have any text above their head.
/viptextoff - Removes the current VIP text they just set.
/vipskinoff - Restores the skin back to the default skin.

Also VIP's get double the amount of cash per kill, planted / defused bomb.
The /vipshop can be used once per round. VIP's will also get a double handed sawn off, double
handed tec 9, double handed colt 45, double handed uzi.

Also make the commands for VIP's only.
Reply

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
pawn Код:
CMD:vcol(playerid, params[])
{
    new vehicleid, color1, color2;
    if((vehicleid = GetPlayerVehicleID(playerid))) {
        if(sscanf(params, "dd", color1, color2)) return SendClientMessage(playerid, -1, "Usage: /vcol [car colour 1] [car colour 2]");
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You' re not driver!");
        ChangeVehicleColor(vehicleid, color1, color2);
        SendClientMessage(playerid, -1, "Vehicle Colours have been changed!);
        return 1;
    }
    else return SendClientMessage(playerid, -1, "
You are not in a vehicle!");
}
Thanks mate!
@Post above, I'd use the AVS script.
EDIT: Misread, don't use the AVS script. ^^
Reply

Quote:
Originally Posted by suhrab_mujeeb
Посмотреть сообщение
These are not called "turfs" they are called "Gang zones". You can create them by using this tool to make them:
https://sampforum.blast.hk/showthread.php?tid=372
thank's alot man +1 rep for you
Reply

Quote:
Originally Posted by slimshady
Посмотреть сообщение
Thanks mate!
Your Welcome slimshady !
Reply

Hello,i need script that player can buy rc model and play with it.
Reply

Quote:
Originally Posted by LarzI
View Post
5 topics in 2-3 years isn't too bad...

About your question: It should be pretty simple actually.
All you need is an updating timer (or OnPlayerUpdate) to get the player's distance to the point, then take the percent of that distance, and update the textdraw each percent (or each 5th percent, 10th etc..)

So let's say the distance is 100 yards (easiest example)
You run 10 yards, and that spot for where are you now moves one "spot" to the right.

You could use GetPlayerDistanceToPoint to make this work easily.
pawn Code:
stock Float:GetPlayerDistanceToPoint(playerid, Float:x, Float:y, Float:z)
{
    new
        Float:pX,
        Float:pY,
        Float:pZ;

    GetPlayerPos(playerid, px, py, pz);
    return floatsqroot(( floatpower( x-pX, 2 ) + floatpower( y-pY, 2 )) + floatpower( z-pZ, 2 ));
}
Just get the percent of the distance.

pawn Code:
new iPercent = (( floatround( GetPlayerDistanceToPoint( playerid, x, y, z )) / distance_to_destination ) * 100 );
Then do as I said, update it every percent, every 5th percent, every 10th percent... Anything that will fit you well.

pawn Code:
if( iPercent > 9 && iPercent < 20 )
{
    //update
}
else if( iPercent > 19 && iPercent < 30 )
//continue
Pawno chrasht bij het compilen van dit script....:S
Reply

I'm looking for this - https://sampforum.blast.hk/showthread.php?tid=32688
Have anyone link for it? Please help.
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)