I am a newb to C++ but I am getting better everyday.
For some days I am working on the PacketHacksource from zeroten. I got some things working.. like KS, KSwith skill.. when I get hit from mob, attack back..
autoHP autoMP and so on.. not that hard.
But anyways, I just skipped the basics -.- so I get stuck sometimes at just such easy things (I gues).
anyway I was making a Dance thingy,
1. when player appears put it in array with ID and Name [v]
2. so when I typ Dance <playerID> <danceID> that player should dance, [x]
This is what I have so far..
PHP Code:
if (strcmp(input,"Dancev2") == 0)
{
DWORD PlayerID;
printf("Wich Player do you wanna make dance?/n");
scanf("%s%*c",&playerName);
printf("Wich DanceID??/n");
scanf("%d%*c",&DanceID);
PlayerID = Dancev2(playerName);
//yeah look in array to the string playername, right?
printf("Player: %s, DanceID %d\n",playerName,DanceID);
SendDetour(0x3d,"db",DplayerID,DanceID);
but my function is CRAP! I dont know how to start my function and what to return:P
I know what's wrong but I dont know how to fix -.-
I insert an String, and look in the array for a match.
then return a DWORD.
PHP Code:
{{what here? void?}} Dancev2(char *playerName)
{
DWORD ReturnID;
for (i=0; i<500; i++)
{
if (Player[i].X > 0)
{
if (Player[i].name = playerName) //gives an error, I know why, but dont know how to fix.
{
ReturnID = Player[i].PID;
}
}
}
return ReturnID;
}
1. what is char[255] diffrent to *char?
hope some of u can help me out. or just give me some explaination about strings and chars..
Thank You,
MartyNL