format(string, sizeof(string) [DOESNT SEND]
#1

pawn Код:
if(strcmp(cmd, "/tazer", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid))
            {
                 if(GetPVarInt(playerid, "HasTazer") == 0) {

                        SetPVarInt(playerid, "HasTazer", 1);
                        GivePlayerWeapon(playerid, 23, 65500);
                        format(string, sizeof(string), "* %s unholsters his tazer", Account[playerid][pName]);
                }
                    else
                {

                    DeletePVar(playerid, "HasTazer");
                    SetPlayerAmmo(playerid, 23, 0);
                    format(string, sizeof(string), "* %s holsters his tazer", Account[playerid][pName]);
                }
               
            }
           
        }
        return 1;
    }
The commands appears and it give the player the gun, but the two sentence don't send
Reply
#2

Under format put:
pawn Код:
SendClientMessageToAll(playerid, string);
Reply
#3

But I want to send it just to near by players
Reply
#4

Loop
IsPlayerInRangeOfPoint
SendClientMessage
Reply
#5

pawn Код:
if(strcmp(cmd, "/tazer", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid))
            {
                 if(GetPVarInt(playerid, "HasTazer") == 0) {

                        SetPVarInt(playerid, "HasTazer", 1);
                        GivePlayerWeapon(playerid, 23, 65500);
                        format(string, sizeof(string), "* %s unholsters his tazer", Account[playerid][pName]);
                    ProxDetector(15.0,playerid,string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                }
                    else
                {

                    DeletePVar(playerid, "HasTazer");
                    SetPlayerAmmo(playerid, 23, 0);
                    format(string, sizeof(string), "* %s holsters his tazer", Account[playerid][pName]);
                    ProxDetector(15.0,playerid,string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);

                }
               
            }
           
        }
        return 1;
    }
Enjoy
Reply
#6

Wheres the ProxDetector code?
Reply
#7

pawn Код:
if(strcmp(cmd, "/tazer", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid))
            {
                 if(GetPVarInt(playerid, "HasTazer") == 0) {

                        SetPVarInt(playerid, "HasTazer", 1);
                        GivePlayerWeapon(playerid, 23, 65500);
                        format(string, sizeof(string), "* %s unholsters his tazer", Account[playerid][pName]);
                   
                }
                    else
                {

                    DeletePVar(playerid, "HasTazer");
                    SetPlayerAmmo(playerid, 23, 0);
                    format(string, sizeof(string), "* %s holsters his tazer", Account[playerid][pName]);
                   
                }
                 ProxDetector(15.0,playerid,string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
               
            }
           
        }
        return 1;
    }
Looks better IMO and cleaner.
Reply
#8

He's going to get errors with both codes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)