Jump to content
  • 0

alta comanda zcmd


vasy

Question

Cum as putea sa fac o comanda pe zcmd

cand scriu de exemplu /cadou

sa dea la tot sv 40kk si 5 score nu ca cer comanda mura-n gura (nu as zice nu daca as primio asa)

dar puteti sa imi dati si tutoriale sa ma ajutat sa o fac

p.s nu vreau sa ia din bani mei cand scriu acest lucru

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Uite tutorial zcmd: http://wiki.sa-mp.ro/index.php/Cum_folosim_Zcmd_si_Sscanf

Tu in comanda ta, nu pui parametru pentru playerid, ci folosesti un loop prin care dai bani tuturor de pe server:

...
for(new i = 0; i < MAX_PLAYERS; i++) 
     if(IsPlayerConnected(i)) {
          GivePlayerMoney(i, 12345);
          SetPlayerScore(i, 5);
     }
...

Link to comment
Share on other sites

[pawn]CMD:cadou(playerid, params [])

{

// Send all players a message to inform them that all players have been healed

new string[256];

new nume[MAX_PLAYER_NAME];

GetPlayerName( playerid, nume, MAX_PLAYER_NAME );

format( string, sizeof string , "{515151}Adminul {FFFFFF}%s[%d] {515151}a dat bani si score la toata lumea", nume, playerid);

SendClientMessageToAll(0x00FF00FF, string);

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

    if(IsPlayerConnected(i)) {

        GivePlayerMoney(i, 5000000);

        SetPlayerScore(i, 5);

    }

return 1;

}[/pawn]

comanda dar daca dau da bani si apoi dispar

adica ii da bani dar nu raman scad inapoi

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Link to comment
Share on other sites

[pawn]

CMD:cadou(playerid, params [])

{

// Send all players a message to inform them that all players have been healed

new string[256];

new nume[MAX_PLAYER_NAME];

GetPlayerName( playerid, nume, MAX_PLAYER_NAME );

format( string, sizeof string , "{515151}Adminul {FFFFFF}%s[%d] {515151}a dat bani si score la toata lumea", nume, playerid);

SendClientMessageToAll(0x00FF00FF, string);

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

    if(IsPlayerConnected(i)) {

        GivePlayerCash(i, 5000000);

        SetPlayerScore(i, 5); // Asta din cate stiu le seteaza tuturor scor 5, nu adauga pe langa ce au.

        // pentru a ramane salvate, trebuie sa le introduci tu fisierul ficarui player.

    }

return 1;

}[/pawn]

Link to comment
Share on other sites

[pawn]// This function processes anti-hack stuff

stock AntiHack(playerid)

{

// Setup local variables

new Float:Armour;

// Skip checking for hacks used by the player if he was reported by the Anti-Hack system already

if (APlayerData[playerid][AutoReportTime] > 0)

{

    // Reduce the time so the player can be reported again soon if he doesn't stop using hacks

    APlayerData[playerid][AutoReportTime]--;

// Exit the function, this skips the hack-checks until the AutoReportTime has reached 0

// Otherwise the player is reported every half a second until he stops using hacks

    return 1;

}

// Check if a filterscript gave some money (or took it) to the player

if (GetPVarInt(playerid, "PVarMoney") != 0)

{

// Add the money to the players account

APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] + GetPVarInt(playerid, "PVarMoney");

// Clear the PVar

SetPVarInt(playerid, "PVarMoney", 0);

}

if (GetPVarInt(playerid, "PVarScore") != 0)

{

// Add the money to the players account

APlayerData[playerid][PlayerScore] = APlayerData[playerid][PlayerScore] + GetPVarInt(playerid, "PVarScore");

// Clear the PVar

SetPVarInt(playerid, "PVarScore", 0);

}

// Reset the player's money and set it to the stored value in the player's account (do the same for scorepoints)

ResetPlayerMoney(playerid);

GivePlayerMoney(playerid, APlayerData[playerid][PlayerMoney]);

SetPlayerScore(playerid, APlayerData[playerid][PlayerScore]);

// Limit the cash that the player can have

if (APlayerData[playerid][PlayerMoney] > 999000000)

    APlayerData[playerid][PlayerMoney] = 999000000;

// Limit the cash that the player can have below 0

if (APlayerData[playerid][PlayerMoney] < -1000000)

    APlayerData[playerid][PlayerMoney] = -1000000;

// Port anyone out of the area who is not an admin and inside the area 69

Player_PortOutAdminZone(playerid, 106.0, 1805.0, -50.0, 285.0, 1940.0, 40.0, 15.0, 1732.0, 25.0);

// Check if the player got any armour (= health-hack)

GetPlayerArmour(playerid, Armour);

// Send an automated report to the admins so they're informed about it and can take action

if (Armour > 1.0)

        SendReportToAdmins(playerid, "Health-hack", true);

// Check if the speed is higher than 300 (kick player if it is)

// Send an automated report to the admins so they're informed about it and can take action

if (APlayerData[playerid][PlayerSpeed] > 400)

        SendReportToAdmins(playerid, "Speed-hack", true);

// Check if the player is not allowed to have a jetpack (admins lvl 3 and higher can use /fly, so they will be excluded)

if (APlayerData[playerid][PlayerLevel] < 0)

{

// Check if the player is using a jetpack

// Send an automated report to the admins so they're informed about it and can take action

if (GetPlayerSpecialAction(playerid) == 2)

        SendReportToAdmins(playerid, "Jetpack-hack", true);

}

// Detect airbreak hack

if (GetPlayerVehicleSeat(playerid) == 0)

{

// Check if the player is nearly standing still

if (APlayerData[playerid][PlayerSpeed] < 10)

{

// Check if the player switched interior-id's

if (GetPlayerInterior(playerid) != APlayerData[playerid][PreviousInt])

{

// Check if the new interior is the normal world or any mod-shop

    switch (GetPlayerInterior(playerid))

{

case 0, 1, 2, 3: // Check interiors 0, 1, 2 and 3 (normal world and all mod-shops)

{

// Store the player's current location and interior-id for the next iteration

GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);

APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);

// Exit the function

return 1;

}

}

}

    // Check if the player is still near the same place he was half a second ago

if (IsPlayerInRangeOfPoint(playerid, 7.5, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]))

{

}

else // Send an automated report to the admins so they're informed about it and can take action

        SendReportToAdmins(playerid, "Airbreak-hack", true);

}

}

// Store the player's current location and interior-id for the next iteration

GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);

APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);

return 1;

}[/pawn]

<a href="http://www.game-state.eu/188.212.105.161:7777/"><img src="http://www.game-state.eu/188.212.105.161:7777/430x73_FFFFFF_FF9900_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.