/robplayer help
#1

pawn Код:
if(strcmp(cmd, "/robplayer", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Nu te-ai logat!");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "UTILIZEAZA: /robplayer [IDJucator/PARTEdinNUME]");
                return 1;
            }
            new cash = GetPlayerMoney(playerid);
            new Float:steal =  cash * 0.10;
            format(string, sizeof(string), "* %s a i-a furat %s RON lui %i.", sendername,floatround(steal), playerid);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            GivePlayerMoney(playerid, floatround(steal));
            return 1;
            if(IsACop(i))
            {
            new anuntpd[255];
            format(anuntpd, sizeof(anuntpd), "DISPECER: Toate unitatile, %s este suspectat de spargerea unui Bancomat",sendername);
            SendClientMessage(i, TEAM_BLUE_COLOR, anuntpd);
            }
        }
    }
Errors:
pawn Код:
D:\lucru\1_3_samp\1.3 samp 0.3e\gamemodes\inaintedetaxi2.pwn(39629) : warning 225: unreachable code
D:\lucru\1_3_samp\1.3 samp 0.3e\gamemodes\inaintedetaxi2.pwn(39629) : error 017: undefined symbol "i"
D:\lucru\1_3_samp\1.3 samp 0.3e\gamemodes\inaintedetaxi2.pwn(39633) : error 017: undefined symbol "i"
Reply
#2

copy this and use it
Quote:

#include <a_samp>
if(strcmp(cmd, "/robplayer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Nu te-ai logat!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "UTILIZEAZA: /robplayer [IDJucator/PARTEdinNUME]");
return 1;
}
new cash = GetPlayerMoney(playerid);
new Floatteal = cash * 0.10;
format(string, sizeof(string), "* %s a i-a furat %s RON lui %i.", sendername,floatround(steal), playerid);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GivePlayerMoney(playerid, floatround(steal));
return 1;
if(IsACop(i))
{
new anuntpd[255];
format(anuntpd, sizeof(anuntpd), "DISPECER: Toate unitatile, %s este suspectat de spargerea unui Bancomat",sendername);
SendClientMessage(i, TEAM_BLUE_COLOR, anuntpd);
}
}
}

Reply
#3

pawn Код:
D:\lucru\1_3_samp\1.3 samp 0.3e\gamemodes\inaintedetaxi2.pwn(39654) : error 017: undefined symbol "steal"
D:\lucru\1_3_samp\1.3 samp 0.3e\gamemodes\inaintedetaxi2.pwn(39656) : error 017: undefined symbol "steal"
D:\lucru\1_3_samp\1.3 samp 0.3e\gamemodes\inaintedetaxi2.pwn(39658) : warning 225: unreachable code
D:\lucru\1_3_samp\1.3 samp 0.3e\gamemodes\inaintedetaxi2.pwn(39653) : warning 204: symbol is assigned a value that is never used: "Steal"
Lines:
pawn Код:
if(strcmp(cmd, "/robplayer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Nu te-ai logat!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "UTILIZEAZA: /robplayer [IDJucator/PARTEdinNUME]");
return 1;
}
new cash = GetPlayerMoney(playerid);
new Float:Steal = cash * 0.10;
format(string, sizeof(string), "* %s a i-a furat %s RON lui %i.", sendername,floatround(steal), playerid);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerMoney(playerid, floatround(steal));
return 1;
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsACop(i))
{
new anuntpd[255];
format(anuntpd, sizeof(anuntpd), "DISPECER: Toate unitatile, %s este suspectat de spargerea unui Bancomat",sendername);
SendClientMessage(i, TEAM_BLUE_COLOR, anuntpd);
}
}
}
Reply
#4

pawn Код:
if(strcmp(cmd, "/robplayer", true) == 0)
{
    if(gPlayerLogged[playerid] == 0)
        return SendClientMessage(playerid, COLOR_GREY, " Nu te-ai logat!");

    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
        return SendClientMessage(playerid, COLOR_GRAD2, "UTILIZEAZA: /robplayer [IDJucator/PARTEdinNUME]");

    new cash = GetPlayerMoney(playerid);
    new Float:steal = cash * 0.10;
    format(string, sizeof(string), "* %s a i-a furat %s RON lui %i.", sendername,floatround(steal), playerid);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerMoney(playerid, floatround(steal));

    for(new i; i < MAX_PLAYERS; i++)
        if(IsACop(i))
        {
            format(string, sizeof(string), "DISPECER: Toate unitatile, %s este suspectat de spargerea unui Bancomat",sendername);
            SendClientMessage(i, TEAM_BLUE_COLOR, string);
        }

    return 1;
}
Reply
#5

I have a problem:
Lines:
pawn Код:
if(strcmp(cmd, "/robplayer", true) == 0)
{
    if(gPlayerLogged[playerid] == 0)
        return SendClientMessage(playerid, COLOR_GREY, " Nu te-ai logat!");

    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    return SendClientMessage(playerid, COLOR_GRAD2, "UTILIZEAZA: /robplayer [IDJucator/PARTEdinNUME]");

    if(PlayerRobbed == 1)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Ai jefuit deja un jucator.");
        return 1;
    }
    new cash = GetPlayerMoney(playerid);
    new Float:steal = cash * 0.10;
    new Nume1[30];
    new Nume2[30];
    new para2;
    para2 = strval(tmp);
    GetPlayerName(playerid, Nume1, sizeof(Nume1));
    GetPlayerName(para2, Nume2, sizeof(Nume2));
    PlayerRob[playerid] = 1;
    PlayerRobTime[playerid] = 30;
    PlayerRobbed = 1;
    WantedLevel[playerid] = 10;
    PlayerInfo[playerid][pSuspect] = 10;
    format(string, sizeof(string), "* %s intinde mana si-i i-a portofelul lui lui %s (%d RON ).", Nume1,Nume2,steal);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerMoney(playerid,floatround(steal))

        for(new i; i < MAX_PLAYERS; i++)
        if(IsACop(i))
        {
            new anuntpd[256];
            format(anuntpd, sizeof(anuntpd), "DISPECER: Toate unitatile, %s este suspectat de jefuirea lui %s!",Nume1,Nume2);
            SendClientMessage(i, TEAM_BLUE_COLOR, anuntpd);
        }

    return 1;
}
And the error i think:


Uploaded with ImageShack.us

The problem is that the string is not showing the stolen money,but amplified.
It's showing a 105376334 number instead of 1 as an example
Reply
#6

A little help please?
Reply
#7

Up!!!
Reply
#8

pawn Код:
format(string, sizeof(string), "* %s intinde mana si-i i-a portofelul lui lui %s (%f RON ).", Nume1,Nume2,steal);
Reply
#9

Is not working is showing like: if i have 2600$ i steal 260$ and it's showing (260.00000)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)