Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; return true and run callback func -> OnSendmycommand(params*)
- ; if comand uncnown return false
- getCommand(dwParams) {
- if (isInChat() = 1) and (not isDialogOpen()) and (not UseAlternative)
- {
- BlockChatInput()
- sleep 250
- dwAddress := dwSAMP + 0x12D8F8
- chatInput := readString(hGTA, dwAddress, 256)
- if ( InStr(chatInput, "/") ) {
- if (StrLen(chatInput) > 0 ) {
- unBlockChatInput()
- params := StrSplit(chatInput, " ")
- dwAddress := dwSAMP + 0x12D8F8
- writeString(hGTA, dwAddress, "")
- AntiCrash()
- funcname = "OnSend"
- funcname .= SubStr(params[1], 1)
- try {
- callback := RegisterCallback(funcname, "F", 3)
- DllCall(callback, "Str", params[2], "Str", params[3], "Str", params[4])
- return true
- } catch e {
- unBlockChatInput()
- AntiCrash()
- return false
- }
- } else {
- unBlockChatInput()
- AntiCrash()
- }
- } else {
- unBlockChatInput()
- AntiCrash()
- }
- }
- return false
- }
Add Comment
Please, Sign In to add comment