Script Request Thread #6
#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


Messages In This Thread
Script Request Thread #6 - by BlueG - 05.02.2013, 21:26
Re: Script Request Thread #6 - by Hade. - 05.02.2013, 21:43
Re: Script Request Thread #6 - by DerickClark - 05.02.2013, 21:45
Re: Script Request Thread #6 - by Vytixz - 05.02.2013, 22:51
Re: Script Request Thread #6 - by antonio112 - 06.02.2013, 06:13
Re: Script Request Thread #6 - by lean1337 - 06.02.2013, 11:10
Re: Script Request Thread #6 - by total3clipse - 07.02.2013, 15:03
Re: Script Request Thread #6 - by DerickClark - 07.02.2013, 23:16
Re: Script Request Thread #6 - by antonio112 - 08.02.2013, 07:13
Re: Script Request Thread #6 - by Hade. - 08.02.2013, 16:48
Re: Script Request Thread #6 - by total3clipse - 08.02.2013, 18:29
Respuesta: Script Request Thread #6 - by Onfroi - 08.02.2013, 20:57
Re: Script Request Thread #6 - by DerickClark - 08.02.2013, 21:01
Re: Script Request Thread #6 - by Bicentric - 08.02.2013, 21:19
Re: Script Request Thread #6 - by SampzzonE - 09.02.2013, 05:03
Re: Script Request Thread #6 - by dorperez - 09.02.2013, 12:28
Re: Script Request Thread #6 - by DerickClark - 09.02.2013, 18:53
Re: Script Request Thread #6 - by Bicentric - 09.02.2013, 19:05
Re: Script Request Thread #6 - by DerickClark - 09.02.2013, 19:14
Re: Script Request Thread #6 - by Bicentric - 09.02.2013, 19:21
Re: Script Request Thread #6 - by NexisHotel - 10.02.2013, 11:20
Re: Script Request Thread #6 - by kalanerik99 - 13.02.2013, 12:43
Re: Script Request Thread #6 - by bensmart469 - 13.02.2013, 12:46
Re: Script Request Thread #6 - by LarzI - 13.02.2013, 12:51
Re: Script Request Thread #6 - by kalanerik99 - 13.02.2013, 14:13
Respuesta: Script Request Thread #6 - by RiChArD_A - 13.02.2013, 20:32
Respuesta: Script Request Thread #6 - by RiChArD_A - 14.02.2013, 12:33
Re: Respuesta: Script Request Thread #6 - by LarzI - 14.02.2013, 13:16
HOW? - by kalanerik99 - 14.02.2013, 17:01
Re: Script Request Thread #6 - by LarzI - 14.02.2013, 20:58
Re: Script Request Thread #6 - by Hade. - 14.02.2013, 21:31
Re: Script Request Thread #6 - by bensmart469 - 17.02.2013, 18:56
Re: Script Request Thread #6 - by RenovanZ - 17.02.2013, 23:51
Re: Script Request Thread #6 - by PabloDiCostanzo - 17.02.2013, 23:58
Re: Script Request Thread #6 - by RenovanZ - 18.02.2013, 00:03
Re: Script Request Thread #6 - by Nivniv2 - 18.02.2013, 04:19
Re: Script Request Thread #6 - by Scenario - 18.02.2013, 07:04
Re: Script Request Thread #6 - by YoYo123 - 18.02.2013, 11:57
Re: Script Request Thread #6 - by conor565 - 18.02.2013, 18:56
Re: Script Request Thread #6 - by DerickClark - 18.02.2013, 22:13
Re: Script Request Thread #6 - by Scenario - 19.02.2013, 00:52
Re: Script Request Thread #6 - by Insulin - 26.02.2013, 02:51
Re: Script Request Thread #6 - by DerickClark - 02.03.2013, 00:58
Re: Script Request Thread #6 - by MehranGta - 02.03.2013, 14:19
Re: Script Request Thread #6 - by NathNathii - 02.03.2013, 14:43
Re: Script Request Thread #6 - by TFreemen - 02.03.2013, 14:56
Re: Script Request Thread #6 - by DerickClark - 02.03.2013, 23:08
Re: Script Request Thread #6 - by L.Hudson - 03.03.2013, 08:13
Re: Script Request Thread #6 - by DerickClark - 03.03.2013, 13:23
Re: Script Request Thread #6 - by AlbertWeSkeR - 04.03.2013, 05:55
Re: Script Request Thread #6 - by ZeroCools - 04.03.2013, 07:15
Re: Script Request Thread #6 - by SomeRandomGuy123 - 04.03.2013, 09:41
Re: Script Request Thread #6 - by Kontrol - 05.03.2013, 10:17
Re: Script Request Thread #6 - by proSeryoga - 05.03.2013, 14:03
Re: Script Request Thread #6 - by Str4ndb3rg - 05.03.2013, 15:42
Respuesta: Re: Script Request Thread #6 - by Strier - 07.03.2013, 07:02
AW: Script Request Thread #6 - by Youtube12 - 07.03.2013, 09:30
Re: Script Request Thread #6 - by RenovanZ - 07.03.2013, 10:59
Re : Script Request Thread #6 - by thegreathom - 07.03.2013, 15:10
Re: Script Request Thread #6 - by RavGaming - 08.03.2013, 00:50
Re: Script Request Thread #6 - by DerickClark - 08.03.2013, 01:52
Re: Re : Script Request Thread #6 - by RenovanZ - 08.03.2013, 10:01
Re: Script Request Thread #6 - by kalanerik99 - 20.03.2013, 04:59
Respuesta: Script Request Thread #6 - by Onfroi - 30.03.2013, 03:53
Re: Script Request Thread #6 - by Joshman543 - 30.03.2013, 03:56
Re: Script Request Thread #6 - by Mr.Dexter - 30.03.2013, 09:46
Respuesta: Script Request Thread #6 - by RiChArD_A - 30.03.2013, 15:13
Re: Script Request Thread #6 - by .Campionull. - 30.03.2013, 16:30
Respuesta: Script Request Thread #6 - by Onfroi - 30.03.2013, 19:49
Re: Script Request Thread #6 - by Louris - 31.03.2013, 09:07
Re: Script Request Thread #6 - by Louris - 02.04.2013, 04:00
Re: Script Request Thread #6 - by StaticYey - 02.04.2013, 19:25
Can Someone Fix me This? - by Matthias134 - 03.04.2013, 02:26
Re: Script Request Thread #6 - by Sliceofdeath - 05.04.2013, 14:07
Re: Script Request Thread #6 - by LarzI - 05.04.2013, 16:48
Respuesta: Script Request Thread #6 - by Matthias134 - 05.04.2013, 18:40
Re: Script Request Thread #6 - by LarzI - 05.04.2013, 19:43
Respuesta: Re: Script Request Thread #6 - by Onfroi - 05.04.2013, 19:54
Re: Script Request Thread #6 - by [..MonTaNa..] - 05.04.2013, 22:01
Re: Respuesta: Re: Script Request Thread #6 - by LarzI - 05.04.2013, 22:57
Re: Script Request Thread #6 - by TehSprit - 06.04.2013, 11:18
Re: Script Request Thread #6 - by LarzI - 06.04.2013, 12:14
Re: Script Request Thread #6 - by Sliceofdeath - 10.04.2013, 16:12
Re: Script Request Thread #6 - by CrayZee09 - 23.04.2013, 06:52
Re: Script Request Thread #6 - by Goldilox - 23.04.2013, 07:07
Re: Script Request Thread #6 - by Red_Dragon. - 23.04.2013, 18:41
Re: Script Request Thread #6 - by Pettersen - 24.04.2013, 13:50
Re: Script Request Thread #6 - by Lucky™ - 24.04.2013, 15:29
Re: Script Request Thread #6 - by AmsterdamCopsAndRobbers - 24.04.2013, 16:58
Re: Script Request Thread #6 - by CrayZee09 - 25.04.2013, 05:40
Re: Script Request Thread #6 - by BossZk - 25.04.2013, 07:29
/race script - by jcfadil - 25.04.2013, 11:18
Re: Script Request Thread #6 - by lQs - 25.04.2013, 15:11
Re: Script Request Thread #6 - by arakuta - 06.05.2013, 21:37
Re: Script Request Thread #6 - by NathNathii - 06.05.2013, 21:38
Re: Script Request Thread #6 - by Th3b3ast5 - 07.05.2013, 01:02
Re: Script Request Thread #6 - by arakuta - 07.05.2013, 01:07
Re: Script Request Thread #6 - by Th3b3ast5 - 07.05.2013, 01:09
Re: Script Request Thread #6 - by arakuta - 07.05.2013, 01:33
Re: Script Request Thread #6 - by UnknownGamer - 07.05.2013, 13:38
Re: Script Request Thread #6 - by Latisha - 09.05.2013, 03:06
Re: Script Request Thread #6 - by NathNathii - 09.05.2013, 17:26
Re: Script Request Thread #6 - by Lordzy - 10.05.2013, 03:07
Re: Script Request Thread #6 - by mohammedsohailahmed - 18.05.2013, 11:19
Re: Script Request Thread #6 - by VanillaRain - 19.05.2013, 12:19
Re: Script Request Thread #6 - by mineralo - 01.06.2013, 06:32
Re: Script Request Thread #6 - by kokoshkata - 01.06.2013, 10:50
Re : Script Request Thread #6 - by morocco - 01.06.2013, 10:52
Re: Re : Script Request Thread #6 - by Red_Dragon. - 01.06.2013, 17:59
Re: Script Request Thread #6 - by Deka - 02.06.2013, 02:59
Re: Script Request Thread #6 - by Scenario - 02.06.2013, 03:03
Re: Script Request Thread #6 - by Deka - 02.06.2013, 14:34
Re: Script Request Thread #6 - by HardRock - 02.06.2013, 19:31
Re: Script Request Thread #6 - by Pettersen - 02.06.2013, 21:16
Re: Script Request Thread #6 - by SupermanV - 03.06.2013, 09:00
Re: Script Request Thread #6 - by SA_Legends - 05.06.2013, 06:25
Re: Script Request Thread #6 - by SA_Legends - 05.06.2013, 17:08
Re: Script Request Thread #6 - by Abanob - 18.06.2013, 21:53
Re: Script Request Thread #6 - by Inverse - 19.06.2013, 15:20
Re: Script Request Thread #6 - by ElAnonymous - 19.06.2013, 23:16
Re: Script Request Thread #6 - by Immortal_LTU - 20.06.2013, 10:53
Re: Script Request Thread #6 - by Mike_Peterson - 20.06.2013, 11:22
Re: Script Request Thread #6 - by Frozty - 21.06.2013, 05:31
Re: Script Request Thread #6 - by Goldilox - 21.06.2013, 06:33
Re: Script Request Thread #6 - by Frozty - 21.06.2013, 07:32
Re: Script Request Thread #6 - by dafuq - 21.06.2013, 10:38
Re: Script Request Thread #6 - by Onfroi - 21.06.2013, 15:53
Re: Script Request Thread #6 - by Vikshay - 22.06.2013, 02:25
Re: Script Request Thread #6 - by Goldilox - 22.06.2013, 03:26
Re: Script Request Thread #6 - by Epraizer - 22.06.2013, 05:12
Re: Script Request Thread #6 - by Frozty - 22.06.2013, 06:07
Re: Script Request Thread #6 - by Goldilox - 22.06.2013, 07:39
Re : Script Request Thread #6 - by KimSangBum - 01.07.2013, 19:47

Forum Jump:


Users browsing this thread: 2 Guest(s)