Script Request Thread #6
#21

Hello , i need arms dealer job script for my Roleplay Server This Script include :

Arms Dealer = That you can /join

Arms Dealer Mat Pickup

This 2 only please give me script , tHanks
Reply
#22

Hi can somewone tell me how to fix this

Reply
#23

Well, define "isnull" or remove it from the script, simple
Reply
#24

Quote:
Originally Posted by kalanerik99
View Post
Hi can somewone tell me how to fix this

http://shrani.si/f/30/Rn/1JfThcYL/untitled.png
In the future, please just link the picture, don't put it in-line.. It extends the forum layout like hell.

Anyway, put this together with your defines:

pawn Code:
//taken from y_utils - a part of the YSI package by ******

#if !defined isnull
    #define isnull(%1) \
        ((%1[0] == 0) || (%1[0] == 1 && %1[1] == 0))
#endif
Reply
#25

THX!
Reply
#26

Hi, I'm looking for the command /teleportto [id] to teleport to a player being rcon logged in. Please don't use scanff, thank you.
Reply
#27

Quote:
Originally Posted by Lauder
View Post
Hi, I'm looking for the command /teleportto [id] to teleport to a player being rcon logged in. Please don't use scanff, thank you.
Please someone help
Reply
#28

Quote:
Originally Posted by Lauder
View Post
Hi, I'm looking for the command /teleportto [id] to teleport to a player being rcon logged in. Please don't use scanff, thank you.
Without sscanf? You want it with zcmd or strcmp then? I'll do both:

pawn Code:
CMD:teleportto(playerid, params[])
{
    if( !IsPlayerAdmin( playerid ))
        return SendClientMessage( playerid, 0xFF0000FF, "[ERROR] Only RCON admins can use this command." );
    if( isnull( params ))
        return SendClientMessage( playerid, 0xFFFF00FF, "[USAGE] /teleport [target id] - teleports you to the player." );
       
    new
                iTarget = strval( params ),
        Float:  fPos[ 3 ]
    ;
       
    GetPlayerPos( iTarget, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
    SetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
    SendClientMessage( playerid, 0x00FF00FF, "[SUCCESS] You've been teleported to the specified player" );
   
    return true;
}
pawn Code:
if( !strcmp( cmdtext, "/teleportto", true ))
{
       
    if( !IsPlayerAdmin( playerid ))
        return SendClientMessage( playerid, 0xFF0000FF, "[ERROR] Only RCON admins can use this command." );
       
    stock const
        params[ 116 ] = cmdtext[ 12 ]
    ;
       
    if( isnull( params ))
        return SendClientMessage( playerid, 0xFFFF00FF, "[USAGE] /teleport [target id] - teleports you to the player." );
       
    new
                iTarget = strval( params ),
        Float:  fPos[ 3 ]
    ;
       
    GetPlayerPos( iTarget, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
    SetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
    SendClientMessage( playerid, 0x00FF00FF, "[SUCCESS] You've been teleported to the specified player" );
   
    return true;
}
This code requires the macro (or function, if you will) 'isnull': Put this together with your defines:

pawn Code:
//taken from y_utils - a part of the YSI package by ******

#if !defined isnull
    #define isnull(%1) \
        ((%1[0] == 0) || (%1[0] == 1 && %1[1] == 0))
#endif
Reply
#29

Hi can somewone tell me how to make:
This Message

This Score Bar
Reply
#30

Quote:
Originally Posted by Hade.
View Post
All's good but one error :S

C:\Users\ilmar\Desktop\Nebuloss Fun\gamemodes\NF-1.pwn(3527) : error 033: array must be indexed (variable "g_iPlayersInVehicle")
Ah yes, my bad. Change this line:

pawn Code:
if( iVehicle == g_iSpawnedVehicles[ i ]  && g_iPlayersInVehicle < 1 )
to this:

pawn Code:
if( iVehicle == g_iSpawnedVehicles[ i ]  && g_iPlayersInVehicle[ i ] < 1 )
Reply
#31

Quote:
Originally Posted by LarzI
View Post
Ah yes, my bad. Change this line:

pawn Code:
if( iVehicle == g_iSpawnedVehicles[ i ]  && g_iPlayersInVehicle < 1 )
to this:

pawn Code:
if( iVehicle == g_iSpawnedVehicles[ i ]  && g_iPlayersInVehicle[ i ] < 1 )
All good now, thanks
Reply
#32

PHP Code:
CMD:dance(playeridparams[])
{
    new 
anim;
    if(
sscanf(params"i"anim)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /dance [1-4]");
    if(
anim || anim 4) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /dance [1-4]");
    switch(
anim)
    {
        case 
1SetPlayerSpecialAction(playeridSPECIAL_ACTION_DANCE1);
        case 
2SetPlayerSpecialAction(playeridSPECIAL_ACTION_DANCE2);
        case 
3SetPlayerSpecialAction(playeridSPECIAL_ACTION_DANCE3);
        case 
4SetPlayerSpecialAction(playeridSPECIAL_ACTION_DANCE4);
    }
    
SetPlayerChatBubble(playerid,"Starts Dancing",0xFFFFFFF,30.0,2500);
    return 
1;

Reply
#33

Hey All, I want to edit vehicle object with 0.3e, Is it posibble to do this ?
pawn Code:
CustomMods[v] = CreateObject(modelid,0.0,0.0,0.0,0.0,0.0,0.0);
                            AttachObjectToVehicle(CustomMods[v], v, 0.0,0.0,0.0,0.0,0.0,0.0);
                            EditObject(playerid, CustomMods[v]);
Reply
#34

Quote:
Originally Posted by Kiyozi_Mu
View Post
Hey All, I want to edit vehicle object with 0.3e, Is it posibble to do this ?
pawn Code:
CustomMods[v] = CreateObject(modelid,0.0,0.0,0.0,0.0,0.0,0.0);
                            AttachObjectToVehicle(CustomMods[v], v, 0.0,0.0,0.0,0.0,0.0,0.0);
                            EditObject(playerid, CustomMods[v]);
Why you don't create your own theard?
Reply
#35

Quote:
Originally Posted by PabloDiCostanzo
View Post
Why you don't create your own theard?
hmm 'kay
Reply
#36

/makemapper [playerid] [1-4] command for admin level 1338,
/m(appers)c(hat)command for the mappers to chat,
/createobject [Object ID] and when the object created, we can move it like Toy Editor 0.3e

Thanks.
Reply
#37

Try this for ya! I wrote this on my iPad, so it COULD be missing something, but I'd doubt it! You'll need the ZCMD and sscanf2 includes, along with the latest version of foreach. You will also need the IsNumeric function if you don't already have it (in that case, search for it).

pawn Code:
new
    pMapperLevel[MAX_PLAYERS] = 0
;

CMD:makemapper(playerid, params[])
{
    new iID, iLevel;
    // add your IsPlayerAdmin < 4 here
    if(sscanf(params, "ud", iID, iLevel))
        return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /makemapper [nick/id] [reason]");
    if(iLevel < 1 || iLevel > 4)
        return SendClientMessage(playerid, COLOR_RED, "Invalid level specified. Valid level's are 1 through 4.");

    new szString[128];
    format(szString, sizeof(szString), "%s has set your mapper level to %d.", getName(playerid), iLevel);
    SendClientMessage(iID, COLOR_GREEN, szString);
    format(szString, sizeof(szString), "You have set %s's mapper level to %d.", getName(iID), iLevel);
    SendClientMessage(playerid, COLOR_RED, szString);

    pMapperLevel[iID] = iLevel;
    return 1;
}

stock getName(playerid)
{
    new szName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, szName, sizeof(szName));
    return szName;
}

CMD:mc(playerid, params[])
{
    if(isnull(params))
        return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /mc [message]");
    if(pMapperLevel[playerid] < 1)
        return 1;

    new szString[128];
    format(szString, sizeof(szString), "Mappers Chat - %s: %s", getName(playerid), params);

    foreach(new i : Player)
    {
        if(pMapperLevel[i] > 0)
        {
            SendClientMessage(i, COLOR_BLUE, szString);
        }
    }
    return 1;
}

CMD:createobject(playerid, params[])
{
    if(isnull(params))
        return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /createobject [object id]");
    if(!IsNumeric(params))
        return SendClientMessage(playerid, COLOR_RED, "ERROR: Object ID's must be numerical!");
   
    new Float:fPos[3];
    GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);
    new object = CreateObject(strval(params), fPos[0], fPos[1], fPos[2], -1, -1, -1);
    EditObject(playerid, object);
    return 1;
}
Reply
#38

Quote:
Originally Posted by King Ace
View Post
/dance 1-3 with ZCMD. I know how to make the animation, but don't know how to make the /dance 1, /dance 2, /dance 3.
If you have sscanf:

pawn Code:
CMD:dance(playerid, params[])
{
   new style;
   if(sscanf(params, "d", style)) return SendClientMessage(playerid, 0xFF000000, "USAGE: /dance (style 1-4)");
   if(style < 1 || style > 4) return SendClientMessage(playerid, 0xFF000000, "Invalid dance style.");
   if(style == 1) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
   if(style == 2) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
   if(style == 3) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE3);
   if(style == 4) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE4);
   return 1;
}
Reply
#39

Can someone please make me a simple GPS command that comes up in a dialog and once you select the location it sets a way point. For the locations just set a format and I'll add them after. Thanks
Reply
#40

Hi i need a /locksever (like dis)

/Locksever (password)
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)