Is this imposible ?
#1

Hey guys, me again with a friendly question... But I think it`s impossible
So here`s what i`m trying to do:

A command, let`s say, /replace oldname newname
And what it does, it replaces ALL the words "oldname" in the script, with "newname"

Ex: /replace PlayerOne PlayerTwo

So, everything in my GameMode (script) will be replaced from PlayerOne to PlayerTwo

This is because i`m trying to make a car seller system, selling the car from PlayerOne to PlayerTwo by replacing his Personal Car Name in the GM from the seller to the person he sold the car to... I hope u understand...

Is it possible? If yes, an idea or something ?
Reply
#2

yes it is.

do crtrl+h,

a little box comes up fill it in

and press yes to all

so somewhere in the script you might have hello and after yu did that, the hello will be changed to hello1 or w.e you change it to
Reply
#3

No, u didn`t get it, i`m trying to make a command so the player will automaticly make the script replace itself, ofcourse i could do it with ctrl+h i knew that, but i`m trying to save the scripter (me) some time...
So basicly i`m trying to make ctrl+h a command ingame, so the player replaces something INSIDE the script from InGame !
Reply
#4

Will use some time, but something like this might work:

pawn Код:
SetPVarInt(p1,"Kills",GetPVarInt(p2,"Kills"));
Etc.
Reply
#5

So if i try

pawn Код:
SetPVarInt(p1,"PlayerOne",GetPVarInt(p2,"PlayerTwo"));
Then PlayerOne will be replaced with PlayerTwo?
Cool... I`ll try and reply back
Reply
#6

I`m trying ...

pawn Код:
if(strcmp(cmd, "/replace", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "/replace [PlayerName]");
                return 1;
            }
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(playerid != INVALID_PLAYER_ID)
                {
                    SetPVarInt(playerid,"RazVan",tmp); // ERROR LINE (27460)
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Player not online...");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "U are not an admin.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD2, "U didn`t connect yet.");
        }
    }
I don`t think it`s right but it should look something like that
Errors :
D:\SAMP Server R7\gamemodes\arth.pwn(27460) : error 035: argument type mismatch (argument 3)

Can someone correct me? Hiddos? Help ?
It would be really great if i could do this and i would definetly release it on sa-mp.com !

So... RazVan is an owner of a car, and when i would type /replace MihaiTZa55, RazVan`s car would be replaced as MihaiTZa55`s car (mine) but i got that error... Help ?

Should I user format( with the %s or somthing ? or something ?
Reply
#7

*bump* cmon guys let`s make this work... it would be a really awesome car dealer ship system
Reply
#8

First you have to know that is a integer and a string then you will find your answer to your problem.
Reply
#9

Quote:
Originally Posted by Lolrofl
Посмотреть сообщение
yes it is.

do crtrl+h,

a little box comes up fill it in

and press yes to all
THANK YOU!! You just saved me from going through 4000+lines of converting "createobject" to "createdynamicobject"

Thank you!
-Kevin
Reply
#10

Quote:
Originally Posted by Kevin_Joshen
Посмотреть сообщение
THANK YOU!! You just saved me from going through 4000+lines of converting "createobject" to "createdynamicobject"

Thank you!
-Kevin
http://www.convertffs.com/

even faster.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)