Posts: 31
Threads: 6
Joined: Mar 2013
Reputation:
0
Hey!
Its my first time I make a server alone, I've already become better at scripting / editing and whatever but..
I got a problem probably simple, all I did this time was changing a command.
I took one letter out of it from /xlock to /lock, I removed the letter everywhere in the script using pwno and
changed the "commands" in my scriptfiles folder..
the thing is.. when I do /lock now it says unknown command.. wtf? all I did was changing the letter and when I compile my script I get no errors.. what could it be ?
please help me out!
Posts: 31
Threads: 6
Joined: Mar 2013
Reputation:
0
Just if this helps..
dcmd_lock(playerid,params[]) {
#pragma unused params
if(IsPlayerConnected(playerid,"lock")) {
if(IsPlayerInAnyVehicle(playerid)) {
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),i,false,true);
new name[24]; VehicleLockData[GetPlayerVehicleID(playerid)] = true; GetPlayerName(playerid,name,24); SendClientMessage(playerid,yellow,"You have locked your car."); return 1;
} else return SendClientMessage(playerid,red,"ERROR: You must be in a vehicle to lock.");
} else return SendLevelErrorMessage(playerid,"lock");
}
dcmd_unlock(playerid,params[]) {
#pragma unused params
if(IsPlayerConnected(playerid,"unlock")) {
if(IsPlayerInAnyVehicle(playerid)) {
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),i,false,false);
new name[24]; VehicleLockData[GetPlayerVehicleID(playerid)] = false; GetPlayerName(playerid,name,24); SendClientMessage(playerid,yellow,"You have unlocked your car."); return 1;
} else return SendClientMessage(playerid,red,"ERROR: You must be in a vehicle to unlock.");
} else return SendLevelErrorMessage(playerid,"unlock");
}
also I changed this at the top.
dcmd(lock,5,cmdtext);
dcmd(unlock,7,cmdtext);
Posts: 1,176
Threads: 114
Joined: May 2012
Reputation:
0
I can't understand anything from the codes as it is really bad organised...
Posts: 1,801
Threads: 21
Joined: Mar 2008
Reputation:
0
Why is there IsPlayerConnected(playerid, "/lock") ?
IsPlayerConnected has only 1 argument, the playerid.
Furthermore did you change
dcmd(xlock, 5, cmdtext);
to
dcmd(lock, 4, cmdtext);
(look at the numbers)
Posts: 31
Threads: 6
Joined: Mar 2013
Reputation:
0
Ohh I found the error, I changed it to clock and it worked.. I already had a /lock command so that probably confused it but thanks for your really fast responds!
Posts: 31
Threads: 6
Joined: Mar 2013
Reputation:
0
one more question though, I changed all that now but it gives me this
undefined symbol "dcmd_lock"
undefined symbol "dcmd_unlock"
number of arguments does not match definition
The last one is just a warning, I ran with that before aswell.. but what exactly does it mean with undefinded symbol? everything should be changed
Thanks for all your fast replays!