Cannot use gamemode cmds after loaded fs? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Cannot use gamemode cmds after loaded fs? (
/showthread.php?tid=69836)
Cannot use gamemode cmds after loaded fs? -
leong124 - 21.03.2009
I cannot use the commands of the gamemode after I've loaded a filterscript,
but the other functions such as clocks,bad word filter,etc. works normal.
I've searched for a little but I cannot find similar questions.
The filterscript consists of scripts below(I list most of them):
-#define (colors)
- in-car talking function in OnPlayerText
Код:
if(text[0] == '=') {
if(IsPlayerInAnyVehicle(playerid)) {
new vehchat[256];
new senderName[MAX_PLAYER_NAME];
new string[256];
strmid(vehchat,text,1,strlen(text));
GetPlayerName(playerid, senderName, sizeof(senderName));
format(string, sizeof(string)," In-car talk %s: %s", senderName, vehchat);
for(new i = 0; i < MAX_PLAYERS; i++) {
if (PlayerVehicle(i) == PlayerVehicle(playerid)){
SendClientMessage(i, LIGHTGREEN, string);
}
}
}
return 0;
}
*Below functions are in OnPlayerCommandText
-strtok in OnPlayerCommandText
-Some basic commands(sendclientmessage,sendclientmessagetoall, etc.)
-function of committing suiside:
Код:
if (strcmp("/kill", cmdtext, true) == 0)
{
SetPlayerHealth(playerid, 0);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
printf("%s has committed suicide.",name);
return 1;
}
-music player(playing the sounds/musics from gtasa)
-lock/unlock car doors
-finding player id
-clearing chat box
*I use main() function for printing the messages on samp-server.exe,and there is no OnFilterScriptInit/Exit*
Could anyone help me?Thanks
Sorry if there is silimar questions
Re: Cannot use gamemode cmds after loaded fs? -
[RP]Rav - 21.03.2009
look at OnPlayerCommandText, is there a "return 1;" at the end? if so remove it
Re: Cannot use gamemode cmds after loaded fs? -
mascii - 21.03.2009
Or change it to 0
Re: Cannot use gamemode cmds after loaded fs? -
leong124 - 21.03.2009
Oh, there's really have "return 1;".
Thanks for both of you to solve my problem