Jump to content
  • 0

Putin ajutor!


alinutz_boy32

Question

Am 2 comenzi dar nu merg...

1

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

{

if(PlayerInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))

{

        new tmp[256], tmp2[256];

    if(!strlen(tmp) || !strlen(tmp2)) return

SendClientMessage(playerid, LIGHTBLUE2, "Usage: /setname [PlayerID] [NewName]") &&

SendClientMessage(playerid, orange, "Function: Will set Name of specified player!");

new player1 = strval(tmp);

new length = strlen(tmp2);

new string[128];

if(length < 3 || length > MAX_PLAYER_NAME) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");

        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)

{

format(string, sizeof(string), "|- You have set \"%s's\" Name to \"%s\" -|", GetName(player1), tmp2);

SendClientMessage(playerid,BlueMsg,string);

if(player1 != playerid)

{

format(string,sizeof(string),"|- Administrator \"%s\" has set your Name to \"%s\" -|", GetName(playerid), tmp2);

SendClientMessage(player1,blue,string);

}

SetPlayerName(player1, tmp2);

  return OnPlayerConnect(player1);

    }

else return SendClientMessage(playerid,red,"ERROR: Player is not connected");

}

else return SendClientMessage(playerid,red,"ERROR: You need to be admin level 3 to use this command");

}[/pawn]

Cand folosesc comanda /setname id  nume imi zice  Function: Will set Name of specified player!

SI a 2 comada

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

{

if(PlayerInfo[playerid][Level] >= 3)

{

    if(!strlen(params)) return

SendClientMessage(playerid, LIGHTBLUE2, "Usage: /eject [PlayerID]") &&

SendClientMessage(playerid, orange, "Function: Will Ejected from vehicle a specified player");

new player1 = strval(params);

new string[128];

if(IsPlayerInAnyVehicle(player1))

{

if(player1 != playerid)

{

format(string,sizeof(string),"|- Administrator \"%s\" has Ejected you from your Vehicle -|", GetName(playerid));

SendClientMessage(player1,blue,string);

}

format(string,sizeof(string)," |- You have ejected \"%s\" from their Vehicle -|", GetName(player1));

SendClientMessage(playerid,BlueMsg,string);

      GetPlayerPos(player1,x,y,z);

return SetPlayerPos(player1,x,y,z+3);

}

else return SendClientMessage(playerid,red,"ERROR: Player is not in a vehicle");

    }

else return ErrorMessages(playerid, 2);

}[/pawn]

Asta cand folosesc /eject ma scoate pe mine  .. cum pot sa fac cand scriu /eject sa nu mearaga pana cand nu scriu si id (/eject id)

Multumesc Sa-Mp.ro

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Salut,comanda aceea scoate pe cel care scrie /eject!Eu iti dau comanda pe care o folosesc pe serverul meu.Am transformato cu ajutorul unui program din STRCMD in ZCMD.Sper sa fie corecta.

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

{

if(IsPlayerConnected(playerid))

{

new State;

if(IsPlayerInAnyVehicle(playerid))

{

State=GetPlayerState(playerid);

if(State!=PLAYER_STATE_DRIVER)

{

SendClientMessage(playerid,COLOR_GREY,"  You can only eject people as the driver !");

return 1;

}

tmp = strtok(cmd, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /eject [playerid/PartOfName]");

return 1;

}

new playa;

playa = ReturnUser(tmp);

new test;

test = GetPlayerVehicleID(playerid);

if(IsPlayerConnected(playa))

{

if(playa != INVALID_PLAYER_ID)

{

if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Eject yourself!"); return 1; }

if(IsPlayerInVehicle(playa,test))

{

new PName[MAX_PLAYER_NAME];

GetPlayerName(playerid,PName,sizeof(PName));

GetPlayerName(playa, giveplayer, sizeof(giveplayer));

format(string, sizeof(string), "* You have thrown %s out of the car!", giveplayer);

SendClientMessage(playerid, COLOR_WHITE, string);

format(string, sizeof(string), "* You have been thrown out the car by %s !", PName);

SendClientMessage(playa, COLOR_WHITE, string);

RemovePlayerFromVehicle(playa);

}

else

{

SendClientMessage(playerid, COLOR_GREY, "  That player is not in your Car !");

return 1;

}

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, " Invalid ID/Name!");

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "  You need to be in a Vehicle to use this !");

}

}

return 1;

}[/pawn]

[move]La Multi Ani![/move]

 

 

Link to comment
Share on other sites

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

{

if(PlayerInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))

{

        new tmp[256], tmp2[256];

if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, LIGHTBLUE2, "Usage: /setname [PlayerID] [NewName]");

SendClientMessage(playerid, orange, "Function: Will set Name of specified player!");

new player1 = strval(tmp);

new length = strlen(tmp2);

new string[128];

if(length < 3 || length > MAX_PLAYER_NAME) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");

if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)

{

format(string, sizeof(string), "|- You have set \"%s's\" Name to \"%s\" -|", GetName(player1), tmp2);

SendClientMessage(playerid,BlueMsg,string);

if(player1 != playerid)

{

format(string,sizeof(string),"|- Administrator \"%s\" has set your Name to \"%s\" -|", GetName(playerid), tmp2);

SendClientMessage(player1,blue,string);

}

SetPlayerName(player1, tmp2);

return OnPlayerConnect(player1);

}

else return SendClientMessage(playerid,red,"ERROR: Player is not connected");

}

else return SendClientMessage(playerid,red,"ERROR: You need to be admin level 3 to use this command");

}[/pawn]

Incearca asta.

Eject: (nu sunt sigur)

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

{

if(PlayerInfo[playerid][Level] >= 3)

{

    new id;

    if(sscanf(params, "u", id)) return SendClientMessage(playerid,orange,"Usage: /eject [playerid]");

new string[128];

if(IsPlayerInAnyVehicle(id))

{

if(id != playerid)

{

format(string,sizeof(string),"|- Administrator \"%s\" has Ejected you from your Vehicle -|", GetName(playerid));

SendClientMessage(id,blue,string);

}

format(string,sizeof(string)," |- You have ejected \"%s\" from their Vehicle -|", GetName(id));

SendClientMessage(playerid,BlueMsg,string);

new x,y,z;

GetPlayerPos(id, x, y, z);

z=z+3;

SetPlayerPos(id, x, y, z);

return 1;

}

else return SendClientMessage(playerid,red,"ERROR: Player is not in a vehicle");

  }

else return ErrorMessages(playerid, 2);

}[/pawn]

Rate me :)

Link to comment
Share on other sites

Refac comanda si revin cu edit.

EDIT:

Try this:

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

{

if(PlayerInfo[playerid][Level] <=3) return SendClientMessage(playerid, red, "ERROR: You are not an administrator!");

new id, newname[64], name[64], string[128], string2[128];

if(sscanf(params, "us", id, newname)) return SendClientMessage(playerid, orange, "Usage: /setname [playerid/name] [new name]");

GetPlayerName(id, name, sizeof(name));

format(string, sizeof(string), "Ai schimbat numele lui %s (ID: %d) in %s.", name, id, newname);

SendClientMessage(playerid, blue, string);

GetPlayerName(playerid, name, sizeof(name));

format(string, sizeof(string2), "%s (ID: %s) ti-a schimbat numele in %s.", name, playerid, newname);

SendClientMessage(id, blue, string2);

SetPlayerName(id, newname);

return 1;

}[/pawn]

Rate me :)

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.