SA-MP Forums Archive
Script Request Thread #6 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Script Request Thread #6 (/showthread.php?tid=413556)

Pages: 1 2 3 4 5 6 7


Re: Script Request Thread #6 - NexisHotel - 10.02.2013

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


Re: Script Request Thread #6 - kalanerik99 - 13.02.2013

Hi can somewone tell me how to fix this




Re: Script Request Thread #6 - bensmart469 - 13.02.2013

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


Re: Script Request Thread #6 - LarzI - 13.02.2013

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



Re: Script Request Thread #6 - kalanerik99 - 13.02.2013

THX!


Respuesta: Script Request Thread #6 - RiChArD_A - 13.02.2013

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.


Respuesta: Script Request Thread #6 - RiChArD_A - 14.02.2013

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


Re: Respuesta: Script Request Thread #6 - LarzI - 14.02.2013

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



HOW? - kalanerik99 - 14.02.2013

Hi can somewone tell me how to make:
This Message

This Score Bar



Re: Script Request Thread #6 - LarzI - 14.02.2013

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 )



Re: Script Request Thread #6 - Hade. - 14.02.2013

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


Re: Script Request Thread #6 - bensmart469 - 17.02.2013

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;




Re: Script Request Thread #6 - RenovanZ - 17.02.2013

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]);



Re: Script Request Thread #6 - PabloDiCostanzo - 17.02.2013

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?


Re: Script Request Thread #6 - RenovanZ - 18.02.2013

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


Re: Script Request Thread #6 - Nivniv2 - 18.02.2013

/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.


Re: Script Request Thread #6 - Scenario - 18.02.2013

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;
}



Re: Script Request Thread #6 - YoYo123 - 18.02.2013

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;
}



Re: Script Request Thread #6 - conor565 - 18.02.2013

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


Re: Script Request Thread #6 - DerickClark - 18.02.2013

Hi i need a /locksever (like dis)

/Locksever (password)