zcmd+sscanf /news -
Jimmi - 21.08.2015
Код:
if(strcmp(cmd, "/news", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
new newcar = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pMuted] >= 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nu poti vorbi, ai mute!");
return 1;
}
if(newcar >= Reporteri[0] && newcar <= Reporteri[12])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[182];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
result[0] = toupper(result[0]);
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /news [newstext]");
return 1;
}
format(string, sizeof(string), "{FFBF00}Reporter %s : %s {00FFFF}", sendername, result);
OOCNews(COLOR_NEWS,string);
PlayerInfo[playerid][pNewsSkill] ++;
Update(playerid, pNewsSkillx);
if(PlayerInfo[playerid][pNewsSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2."); }
else if(PlayerInfo[playerid][pNewsSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3."); }
else if(PlayerInfo[playerid][pNewsSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4."); }
else if(PlayerInfo[playerid][pNewsSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5."); }
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nu esti in duba reporterilor sau in elicopter!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nu esti un reporter!");
}
}//not connected
return 1;
}
Please move to zcmd+sscanf
Re: zcmd+sscanf /news -
Jimmi - 21.08.2015
upppp
Re: zcmd+sscanf /news -
Sabur - 21.08.2015
Код:
CMD:news(playerid, params[])
{
static
string[128],
result[80],
sendername[24];
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
return SendClientMessage(playerid, COLOR_GREY, "Nu esti un reporter!");
if(!IsPlayerInVehicle(playerid, Reporteri[0] && !IsPlayerInVehicle(playerid, Reporteri[12])
return SendClientMessage(playerid, COLOR_GREY, "Nu esti in duba reporterilor sau in elicopter!");
if(sscanf(params, "s[80]", result))
return SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /news [newstext]");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "{FFBF00}Reporter %s : %s {00FFFF}", sendername, result);
OOCNews(COLOR_NEWS,string);
PlayerInfo[playerid][pNewsSkill] ++;
Update(playerid, pNewsSkillx);
if(PlayerInfo[playerid][pNewsSkill] == 50) {
SendClientMessage(playerid, COLOR_YELLOW, "* Your news reporter skill is now level 2."); }
else if(PlayerInfo[playerid][pNewsSkill] == 100) {
SendClientMessage(playerid, COLOR_YELLOW, "* Your news reporter skill is now level 3."); }
else if(PlayerInfo[playerid][pNewsSkill] == 200) {
SendClientMessage(playerid, COLOR_YELLOW, "* Your news reporter skill is now level 4."); }
else if(PlayerInfo[playerid][pNewsSkill] == 400) {
SendClientMessage(playerid, COLOR_YELLOW, "* Your news reporter skill is now level 5."); }
return 1;
}
Re: zcmd+sscanf /news -
dominik523 - 21.08.2015
@Sabur that will not help him. You could put a link to tutorial here insted of doing everything for him.
https://sampforum.blast.hk/showthread.php?tid=280476
Re: zcmd+sscanf /news -
Jimmi - 21.08.2015
and this please
Код:
if(strcmp(cmd, "/live", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
if(TalkingLive[playerid] != 255)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Live Conversation terminata.");
SendClientMessage(TalkingLive[playerid], COLOR_LIGHTBLUE, "* Live Conversation s-a terminat.");
TogglePlayerControllable(playerid, 1);
TogglePlayerControllable(TalkingLive[playerid], 1);
TalkingLive[TalkingLive[playerid]] = 255;
TalkingLive[playerid] = 255;
return 1;
}
if(PlayerInfo[playerid][pRank] < 3)
{
SendClientMessage(playerid, COLOR_GREY, " You need rank 3+ !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{00FF00}Folosire:{FFFFFF} /live [playerid/numejucator]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Talk Live with yourself!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* L-ai invitat pe %s la o Live Conversation.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s te-a invitat sa aveti o conversatie Live. (/accept live)", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
LiveOffer[giveplayerid] = playerid;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Esti departe de jucator!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Invalid ID/Name !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nu esti membru Kanal D.");
}
}//not connected
return 1;
}
Re: zcmd+sscanf /news -
Jimmi - 21.08.2015
uppppp
Re: zcmd+sscanf /news -
Jimmi - 21.08.2015
upppp
Re: zcmd+sscanf /news -
jamal1992 - 21.08.2015
Take it easy man

)) you have a command like landmark from sabur, take a look and make it yourself that.
Re: zcmd+sscanf /news -
Jimmi - 21.08.2015
and this please
Код:
if(strcmp(cmd, "/live", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
if(TalkingLive[playerid] != 255)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Live Conversation terminata.");
SendClientMessage(TalkingLive[playerid], COLOR_LIGHTBLUE, "* Live Conversation s-a terminat.");
TogglePlayerControllable(playerid, 1);
TogglePlayerControllable(TalkingLive[playerid], 1);
TalkingLive[TalkingLive[playerid]] = 255;
TalkingLive[playerid] = 255;
return 1;
}
if(PlayerInfo[playerid][pRank] < 3)
{
SendClientMessage(playerid, COLOR_GREY, " You need rank 3+ !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{00FF00}Folosire:{FFFFFF} /live [playerid/numejucator]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Talk Live with yourself!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* L-ai invitat pe %s la o Live Conversation.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s te-a invitat sa aveti o conversatie Live. (/accept live)", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
LiveOffer[giveplayerid] = playerid;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Esti departe de jucator!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Invalid ID/Name !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nu esti membru Kanal D.");
}
}//not connected
return 1;
}