Jump to content

Tutoriale/Comenzi/Functii/Informatii


cmg4life

Recommended Posts

Acest topic contie multe tutoriale, cautati-le folosind functia Cauta !!!

Forum TipS:

Cine vrea sa posteze coduri direct puneti intai pe sa-mp.ro.pastebin.com sau pastebin.com si dupa luati linkul si postati-l codurile lungi vor fii sterse...

Daca vreti sa puneti poze folositi www.imageshack.us si puneti linkul in topic.

O sa incercam sa facem rost de un hoster... dar pana atunci folositi cele de mai sus...

Codul BB:

Tagurile Codului BB, fara punctul dupa [ adica, [.  inseamna [

[.url] [./url]  [.img] [./img] [.b] [./b] [.u] [./u] [.color=COLOR] [./color] [.size=10pt] [./size] si multe altele :P

Cand le deschideti (  [deschis] ) trebuie sa le si inchideti  ( [/inchis] )

Alte sugestii ( de tips )  sunt bine primite, postati le si vor fi adaugate :)

:)


Ce cuprinde topicul:

Comenzi

Cateva functii

NameCheck

CallBacks

Gate

AFK+BACK

ComenziRcon

TextFun

-Toate tutorialele postate intra aici sau puneti-le direct [url=http://www.sa-mp.ro/forum/index

Link to comment
Share on other sites

  • Replies 183
  • Created
  • Last Reply

Top Posters In This Topic

Guest Mihaitu

Aceste culori se folosesc la codul HTML...

1. Citeste ce a spus cmg :

pt a le face pentru PawnO -> SA-MP    schimbati # cu 0x si adugati FF la sfarsit adica ... #123456  ->  0x123456FF

2. >>> Cursed Pickup by Mihaitu

Pickup-ul blestemat : cand este luat , playerul ia un KICK .

Dupa toate includerile si definirile :

new pkick;

In OnFilterScriptInIt()

pkick = CreatePickup(modelid, 2, x, y, z);

La sfarsitul scriptului :

public OnPlayerPickUpPickup(playerid, pickupid)

{

    if(pickupid == pkick)

    {

        Kick(playerid);

    }

    return 1;

}

Dictionarul termenilor :

modelid = tipul pickup-ului (lista pe wiki , la functia CreatePickup)

x, y, z : co-ordonatele unde sa fie pus pickupul (le puteti lua cu samp_debug)

pkick = numele definit al pickupului (pe termeni "sofisticati" -> variabila)

Nelamuriri ? Stitzi sa ma PM-ati ! :D:P

Enjoy ;)

Link to comment
Share on other sites

Guest Mihaitu

Ar fi folositor si un File Host , ex Rapidshare , pentru cei care vor sa uploadeze .amx-uri ; .map-uri ; .pwnuri etc

www.rapidshare.com

www.mediafire.com

www.megaupload.com

www.dump.ro

folositi-le sa uploadati fisierele de care aveti nevoie , luati Download-Linkul , paste aici si gata !

Link to comment
Share on other sites

Guest el3ctr0n

Mihaitu, cei ce nu au cont premium pe rapidshare trebuie sa tasteze un cod de 6 cifre, si casuta aia permite doar 4 ... deci e intr-un fel inutilizabila

Link to comment
Share on other sites

Guest Mihaitu

Mihaitu, cei ce nu au cont premium pe rapidshare trebuie sa tasteze un cod de 6 cifre, si casuta aia permite doar 4 ... deci e intr-un fel inutilizabila

Mie nu mi s-a intamplat asa ceva niciodata ! Folosesc Rapidshare de ffff mult timp si nu am patit asta ! Si NU am cont premium !

Link to comment
Share on other sites

scuzati x2 post DAR

Mihaitu, cei ce nu au cont premium pe rapidshare trebuie sa tasteze un cod de 6 cifre, si casuta aia permite doar 4 ... deci e intr-un fel inutilizabila

De fapt, tre sa pui 4 cifre care contin pisica in pozitia aia, voi puneti toate, sunt 2 kre au alta pisica, alea nu le puneti ;)

-Toate tutorialele postate intra aici sau puneti-le direct [url=http://www.sa-mp.ro/forum/index

Link to comment
Share on other sites

  • 2 weeks later...

PS: It's "Useful Functions", not "Usefull functions".

GivePlayerHealth(playerid, Float:health)

playerid - playerid, who we are giving health to

Float:health - amount of health we're giving

stock GivePlayerHealth(playerid, Float:health)

{

    new Float:pHealth;

    GetPlayerHealth(playerid, pHealth);

    SetPlayerHealth(playerid, pHealth + health);

}

SetPlayerMoney(playerid, money)

playerid - playerid, who's money we're setting

money - amount of money what we're setting player's money to

stock SetPlayerMoney(playerid, money)

{

    ResetPlayerMoney(playerid);

    GivePlayerMoney(playerid, money);

}

PlayerToPoint(Float:radi, playerid, X, Y, Z) (NOTE: not by me)

Float:radi - radius

playerid - player that we're checking

Float:x, Float:y, Float:z - The position we're checking player's length from

stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)

{

    new Float:oldposx, Float:oldposy, Float:oldposz;

    new Float:tempposx, Float:tempposy, Float:tempposz;

    GetPlayerPos(playerid, oldposx, oldposy, oldposz);

    tempposx = (oldposx -x);

    tempposy = (oldposy -y);

    tempposz = (oldposz -z);

    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))

    {

        return 1;

    }

    return 0;

}

StopMusic(playerid)

playerid - player that we're stopping the music for

stock StopMusic(playerid)

{

PlayerPlaySound(playerid, 1069, 0.0, 0.0, 0.0);

}

IsStringAName(string[]) (NOTE: Not by me)

string[] - String we're checking for name

stock IsStringAName(string[])

{

    for(new i = 0; i <= MAX_PLAYERS; i++)

    {

        if(IsPlayerConnected(i) == 1)

{

    new testname[MAX_PLAYER_NAME];

            GetPlayerName(i, testname, sizeof(testname));

    if(strcmp(testname, string, true, strlen(string)) == 0)

    {

                return 1;

            }

        }

    }

    return 0;

}

GetPlayerID(string[]) (NOTE: not by me)

string[] - the string, which contains a player name, which ID we're getting

stock GetPlayerID(string[])

{

    for(new i = 0; i <= MAX_PLAYERS; i++)

    {

        if(IsPlayerConnected(i) == 1)

{

            new testname[MAX_PLAYER_NAME];

    GetPlayerName(i, testname, sizeof(testname));

    if(strcmp(testname, string, true, strlen(string)) == 0)

    {

        return i;

    }

}

    }

    return INVALID_PLAYER_ID;

}

sig.gif
Link to comment
Share on other sites

  • 4 weeks later...
Guest Zh3r0

Cum sa misti un obiect.

Sus de tot mai jos de #include <a_samp>

new Blah;
In OnGameModeInit/OnFilterScriptInit
Blah = CreateObject(8040,2354.966,-1244.319,676.305,0.0,0.0,180.000);
Asta in OnPlayerCommandText
if(strcmp(cmdtext,"/misca",true)==0)
{
  MoveObject(Blah,2354.9456,-12435.33459,676.500,10);
  SendClientMessage(playerid, COLOR_RED, "Se misca, in progres.");
  return 1;
}

10 = Viteza cu care o sa se miste obiectul daca setezi la 1 o sa se miste ca o broasca ;D

Float:x,Float:y,Float:z = Coordonatele din San Andreas ;).

Si ce sa zic, asta i tot ;D ;D ;D

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...

Aici postez niste comenzi folositoare tuturor care isi fac server de stunt/dm/race/drift orice ;)

Comanda de blocare si deblocare la masina

/lock

http://pastebin.com/f75ea06e7

/unlock

http://pastebin.com/fa98c50a

Comanda de reparat masina

/fix

http://pastebin.com/f1c609daa

Comanda de intoarcerea masinii cu rotile pe drum

/flip

http://pastebin.com/f6e7e6e91

Comanda Nitro

/nos

http://pastebin.com/f73a7fcd4

Comanda de dat altui player bani

/givecash

http://pastebin.com/f70847c81

Comanda de sinucidere

/kill

http://pastebin.com/f56e53275

Comanda de 'curatat chat-ul'

/clean

http://pastebin.com/f74cc3aa0

Comanda GODMODE(viata infinita)

/god

http://pastebin.com/f6a9914db

Comanda pentru Roadblock

/roadblock

/removeroadblock

http://pastebin.com/f474303a

Comanda pentru Hitman (sa pui o suma de bani pe capul unuia)

/hitman

http://pastebin.com/f50bd524b

Animatii

http://pastebin.com/f696baf13

Schimbi culoarea playerului

http://pastebin.com/f24195459

Dai avertismente/reclame la ceva

http://pastebin.com/f59bf7766

Salvezi un anumit loc si cu a 2-a comanda te teleportezi acolo

/s

http://pastebin.com/f2007d5c9

/r

http://pastebin.com/f3cc76c61

Te da la o inaltime foarte mare din locul unde te aflii

/bigfall

http://pastebin.com/f520a8ff7

Reportezi un player care foloseste coduri/..etc unui admin

/report <text>

http://pastebin.com/f1a41b91f

Blochezi serverul

/lockserver

http://pastebin.com/f23b6f20d

Schimbi skinul

/setskin [0 - 299]

http://pastebin.com/f78dd2a15

Schimbi culoarea masinii

/carcolor [id culoare]

http://pastebin.com/f76ccf230

Dai viata tuturor dupa server

/healall

http://pastebin.com/f471fb862

Dai armura tuturor dupa server

/armourall

http://pastebin.com/f5e23c7c5

Te pui away from keyboard

/afk

http://pastebin.com/f6b6ec2a8

Revii din AFK

/back

http://pastebin.com/f58c81457

Daca vreun link nu functioneaza anuntatima!!!

Noi comenzi in curand ;D ;)

Imi aduc aminte cand jucam pe versiunea 0.1.. ala era SA-MP adevarat.

Va salut cu respect (pe cei care merita).

Link to comment
Share on other sites

Comanda de 'curatat chat-ul'

	if (strcmp("/clean", cmdtext, true == 0) {
               for(new i=0; <50; i++) SendClientMessageToAll(0x000000AA, " ");
		return 1; }

heatON, modifica codul meu cu cel de mai sus.

Thanks cmg4life for debugging  !

Link to comment
Share on other sites

si comanda /clean la ce foloseste ??

pai daca cineva vorbeste pe chat si vrei sa stergi toate mesajele care au fost scrise de playeri dai /clea si dispare mesajele si va fi gol ca si cand te conectezi

Imi aduc aminte cand jucam pe versiunea 0.1.. ala era SA-MP adevarat.

Va salut cu respect (pe cei care merita).

Link to comment
Share on other sites

GODMODE

NEW

new pGod[MAX_PLAYERS];
    if(strcmp(cmdtext, "/god", true) == 0)
    {
			if(pGod[playerid] == 0)
			{
			pGod[playerid] = 1;
			SetPlayerHealth(playerid,99999);
			SetPlayerArmour(playerid,99999);
			SendClientMessage(playerid,0xFF0606FF,"[Fadmin] GODMODE is ON!");
			}else{
			pGod[playerid] = 0;
			SetPlayerArmour(playerid,100);
			SetPlayerHealth(playerid,100);
			SendClientMessage(playerid,0xFF0606FF,"[Fadmin] GODMODE is OFF!");
			}
    return 1;
    }

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.