Hola a todos! Aqui yo de nuevo despues de una larga hibernacion...
![]() Resulta que tengo el Ravens Roleplay... Despies de haberlo probado y demas... Me entere de varias cosas que me gustaria que me ayuden... 1. Primero. Al usar la posicion que nos da el /newspaper; al llegar a la localizacion de camionero ... Por ningun lado sale el icono de informacion (para obtener el trabajo) estuve viendo por encime el script del gm y no vi nada. 2. Segundo. Algunas facciones no les sirve el comando /invite osea que no se puede invitar a nadie a la faccion, solo el lider nombrado por algun admin... 3. Tercero. El comando para vender drogas en el mercado negro no funciona ( en este gm solo en el mercado negro se pueden vender las drogas ) Eso seria por ahora de momento... Si me pueden ayudar les agradeceria montones de montones. Muchas gracias |
//----------------------------------[INVITE]------------------------------------------------
if(strcmp(cmd, "/invite", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /invite [playerid/PartOfName]");
return 1;
}
new para1;
new ftext[20];
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
{
if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Police Force"; ChosenSkin[para1] = 71; SetPlayerSkin(para1, 71); }
else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI/ATF"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "National Guard"; ChosenSkin[para1] = 287; SetPlayerSkin(para1, 287); }
else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Firemen/Ambulance"; ChosenSkin[para1] = 70; SetPlayerSkin(para1, 70); }
else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Surenos"; ChosenSkin[para1] = 116; SetPlayerSkin(para1, 116); }
else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 6; gTeam[para1] = 6; ftext = "La Famiglia Sinatra"; ChosenSkin[para1] = 125; SetPlayerSkin(para1, 125); }
else if(PlayerInfo[playerid][pLeader] == 7) { return 1; }
else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 12; ftext = "Hitman Agency"; ChosenSkin[para1] = 249; SetPlayerSkin(para1, 249); }
else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "ABC Studio"; ChosenSkin[para1] = 148; SetPlayerSkin(para1, 148); }
else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxi Cab Company"; ChosenSkin[para1] = 255; SetPlayerSkin(para1, 255); }
else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "School Instructors"; ChosenSkin[para1] = 59; SetPlayerSkin(para1, 59); }
else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Yamaguchi"; ChosenSkin[para1] = 169; SetPlayerSkin(para1, 169); }
else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 15; gTeam[para1] = 15; ftext = "Chornaya Bratva"; ChosenSkin[para1] = 258; SetPlayerSkin(para1, 258); }
else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "La Vice"; ChosenSkin[para1] = 143; SetPlayerSkin(para1, 143); }
else { return 1; }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
PlayerInfo[para1][pRank] = 1;
printf("AdmCmd: %s has invited %s to join %s.", sendername, giveplayer, ftext);
format(string, sizeof(string), " You have Joined the %s, you were invited by Leader %s", ftext, sendername);
SendClientMessage(para1, COLOR_WHITE, string);
format(string, sizeof(string), " You have Invited %s to join the %s.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is currently Wanted / a Different Team / or already a Family Member.");
return 1;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command(leaders only)!");
}
}
return 1;
}
if(strcmp(cmd, "/selldrugsto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 20)
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Drugs Smuggler!");
return 1;
}
if(!IsPlayerInRangeOfPoint(playerid, 15,1484.3933,-1731.2124,6.7213))
{
SendClientMessage(playerid, COLOR_GREY, " You are not at black market!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /selldrugsto [playerid/PartOfName] [ammount] [price]");
return 1;
}
new playa;
new money;
new needed;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
needed = strval(tmp);
if(needed < 1 || needed > 99) { SendClientMessage(playerid, COLOR_GREY, " Grams not lower then 1, or above 99!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
money = strval(tmp);
if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, " Price not lower then 1, or above 99999!"); return 1; }
if(needed > PlayerInfo[playerid][pDrugs]) { SendClientMessage(playerid, COLOR_GREY, " You dont have that much Drugs with you !"); return 1; }
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, playa))
{
if(playa == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " Cant sell to yourself!");
return 1;
}
if(PlayerInfo[playa][pJob] != 4)
{
SendClientMessage(playerid, COLOR_GREY, "You can sell drugs only to drugs dealers!");
return 1;
}
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You offerd %s to buy %d gram of drugs for $%d .", giveplayer, needed, money);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Drug Smuggler %s wants to sell you %d gram for $%d, (type /accept drugs) to buy.", sendername, needed, money);
SendClientMessage(playa, COLOR_WHITE, string);
DrugOffer[playa] = playerid;
DrugPrice[playa] = money;
DrugGram[playa] = needed;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is offline.");
}
}
return 1;
}
if(strcmp(cmd, "/say", true) == 0) // By CuervO_NegrO
{
if (PlayerInfo[playerid][pAdmin] >= 5)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
idx++;
if(!strlen(result)) return SendClientMessage(playerid, COLOR_GREY, "USO: /say [texto]");
format(string, sizeof(string), "* Admin: %s", ((result));
SendClientMessageToAll(0x2587CEFF, string);
format(string, sizeof(string), "[ADMIN]: %s Has Wrote At the Console: [ADM: %s]", sendername, (result));
ABroadCast(COLOR_LIGHTRED,string, 5);
SaveStuff();
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Wrote at the Console: [Admin: %s]",d,m,y,h,mi,s,sendername,(result));
AdminLog(string);
}
return 1;
}
Ehmmm...
Puedo agregar otro pedido? Quiero que el comando /say del administrador Muestre en el chat el nombre del administrador que lo usa... No se si me entienden ![]() pawn Код:
|
if(strcmp(cmd, "/say", true) == 0) // By CuervO_NegrO
{
if (PlayerInfo[playerid][pAdmin] >= 5)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
idx++;
if(!strlen(result)) return SendClientMessage(playerid, COLOR_GREY, "USO: /say [texto]");
GetPlayerName(playerid,sendername,sizeof(sendername));
format(string, sizeof(string), "* Admin %s: %s",sendername,(result));
SendClientMessageToAll(0x2587CEFF, string);
format(string, sizeof(string), "[ADMIN]: %s Has Wrote At the Console: [ADM: %s]", sendername, (result));
ABroadCast(COLOR_LIGHTRED,string, 5);
SaveStuff();
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Wrote at the Console: [Admin: %s]",d,m,y,h,mi,s,sendername,(result));
AdminLog(string);
}
return 1;
}
if(strcmp(cmd, "/say", true) == 0) // By CuervO_NegrO
{
if (PlayerInfo[playerid][pAdmin] >= 5)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
idx++;
if(!strlen(result)) return SendClientMessage(playerid, COLOR_GREY, "USO: /say [texto]");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Admin %s: %s", sendername,((result));
SendClientMessageToAll(0x2587CEFF, string);
format(string, sizeof(string), "[ADMIN]: %s Has Wrote At the Console: [ADM: %s]", sendername, (result));
ABroadCast(COLOR_LIGHTRED,string, 5);
SaveStuff();
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Wrote at the Console: [Admin: %s]",d,m,y,h,mi,s,sendername,(result));
AdminLog(string);
}
return 1;
}
Proba con este el de ariva no creo que te funcione :S, de la forma que lo quieres vos.
pawn Код:
|
Men esto es cuestiуn de ser atento si ves, a el solo le faltaba el GetPlayerName sobre el Sendername y listo....
No tenias que colocar el SendClientMessageAll etc... ya que el gm que tiene el tiene la funcion ABroadCast que sirve para enviarle mensajes a los que son admins. |
jejeje nose d q estas ablando lo unico que le puse es
GetPlayerName(playerid,sendername,sizeof(sendernam e)); y donde desia ("* admin: %s",(result))...... agrege el ("* admin %s: %s",sendername,(result))..... y nada mas no se de que ablas vosss |
//----------------------------------[INVITE]------------------------------------------------
if(strcmp(cmd, "/invite", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /invite [playerid/PartOfName]");
return 1;
}
new para1;
new ftext[20];
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
{
if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Police Force"; ChosenSkin[para1] = 71; SetPlayerSkin(para1, 71); }
else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI/ATF"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "National Guard"; ChosenSkin[para1] = 287; SetPlayerSkin(para1, 287); }
else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Firemen/Ambulance"; ChosenSkin[para1] = 70; SetPlayerSkin(para1, 70); }
else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Surenos"; ChosenSkin[para1] = 116; SetPlayerSkin(para1, 116); }
else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 6; gTeam[para1] = 6; ftext = "La Famiglia Sinatra"; ChosenSkin[para1] = 125; SetPlayerSkin(para1, 125); }
else if(PlayerInfo[playerid][pLeader] == 7) { return 1; }
else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 12; ftext = "Hitman Agency"; ChosenSkin[para1] = 249; SetPlayerSkin(para1, 249); }
else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "ABC Studio"; ChosenSkin[para1] = 148; SetPlayerSkin(para1, 148); }
else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxi Cab Company"; ChosenSkin[para1] = 255; SetPlayerSkin(para1, 255); }
else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "School Instructors"; ChosenSkin[para1] = 59; SetPlayerSkin(para1, 59); }
else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Firemen; }
else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Bikers; }
else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Yamaguchi"; ChosenSkin[para1] = 169; SetPlayerSkin(para1, 169); }
else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 15; gTeam[para1] = 15; ftext = "Chornaya Bratva"; ChosenSkin[para1] = 258; SetPlayerSkin(para1, 258); }
else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "La Vice"; ChosenSkin[para1] = 143; SetPlayerSkin(para1, 143); }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
PlayerInfo[para1][pRank] = 1;
printf("AdmCmd: %s has invited %s to join %s.", sendername, giveplayer, ftext);
format(string, sizeof(string), " You have Joined the %s, you were invited by Leader %s", ftext, sendername);
SendClientMessage(para1, COLOR_WHITE, string);
format(string, sizeof(string), " You have Invited %s to join the %s.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is currently Wanted / a Different Team / or already a Family Member.");
return 1;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command(leaders only)!");
}
}
return 1;
}
if(strcmp(cmd, "/selldrugsto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 20)
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Drugs Smuggler!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /selldrugsto [playerid/PartOfName] [ammount] [price]");
return 1;
}
new playa;
new money;
new needed;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
needed = strval(tmp);
if(needed < 1 || needed > 99) { SendClientMessage(playerid, COLOR_GREY, " Grams not lower then 1, or above 99!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
money = strval(tmp);
if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, " Price not lower then 1, or above 99999!"); return 1; }
if(needed > PlayerInfo[playerid][pDrugs]) { SendClientMessage(playerid, COLOR_GREY, " You dont have that much Drugs with you !"); return 1; }
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, playa))
{
if(playa == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " Cant sell to yourself!");
return 1;
}
if(PlayerInfo[playa][pJob] != 4)
{
SendClientMessage(playerid, COLOR_GREY, "You can sell drugs only to drugs dealers!");
return 1;
}
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You offerd %s to buy %d gram of drugs for $%d .", giveplayer, needed, money);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Drug Smuggler %s wants to sell you %d gram for $%d, (type /accept drugs) to buy.", sendername, needed, money);
SendClientMessage(playa, COLOR_WHITE, string);
DrugOffer[playa] = playerid;
DrugPrice[playa] = money;
DrugGram[playa] = needed;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is offline.");
}
}
return 1;
}